Skip to main content

Full text of "Dr. Dobb's Journal - Vol 3"

See other formats


Dr. DoBB'S (OURNALof 

COMPUTER 

(Calisthenics Orthodontia 

Running Light Without Overbyte 


A Reference Journal for Users of Home Computers 


Volu me Th ree 




I’i The People’s Computer Company Series 
























4 




\ 

j 









Dr. Dobb’s Journal 

of Computer Calisthenics 6 Orthodontia, 

Volume Three 




1 








Dr. DoBB'S JOURNALof 

COMPUTER 

(Calisthenics ^5 Orthodontia 

Running Light Without Overbyte 


A Reference Journal for Users of Home Computers 


Volume Th ree 



K3 The People's Computer Company Series 


[7TI HAYDEN BOOK COMPANY, INC. 
1 H I Rochelle Park, New Jersey 











Acknowledgments 

Profuse thanks to all the authors and readers who contribute articles and share 
ideas with Dr. Dobb’s. Dr. Dobb's Journal, distributed worldwide, owes its 
existence to you. Thanks also to the employees and other supporters of People’s 
Computer Company who have seen Dr. Dobb’s through its inception, growing 
pains and success. 

Full-page computer art by David Dameron. 

Linocut of griffin by Wendy Palmer. The mythological griffin, half lion and half 
eagle, has long stood as an enemy of ignorance. 


ISBN 0-8104-54904 


Copyright ©1980 by People’s Computer Company. All rights reserved. No 
part of this book may be reprinted, or reproduced, or utilized in any form or 
by any electronic, mechanical, or other means, now known or hereafter invented, 
including photocopying and recording, or in any information storage and 
retrieval system, without permission in writing from the Publisher. 

Printed in the United States of America 


3 4 5 6 7 8 9 PRINTING 


81 82 83 84 85 86 87 88 


YEAR 



Editors Prefa ce 


The third volume of Dr. Dobb's Journal represented a year of growth and maturity in the 
field of small computers, a maturity evident among manufacturers and users. Although Dr. 
Dobb’s has always been primarily a software journal, Volume III reflects this increased sophisti¬ 
cation with a substantial increase in the number of software articles. It branched out to include 
more microprocessors, most notably the 6502, used in the Apple, PET, and KIM 1. Software 
was somewhat different from that submitted in 1977; the earlier emphasis on systems yielded 
to the exploration of programming languages and to theoretical articles on computing in 
general. New implementations of languages for microcomputers SAM-76, UCSD PASCAL, 
BASEX, and FORTH were given extensive treatment. 

Yet, there were still specialized applications, utilities, and unique discoveries made by 
readers eager to share their findings. Graphics programs for various systems, a Z-80 debugger, a 
KIM-1 editor, a renumbering program for the Apple, several 6502 cassette interface routines, 
and much, much more were published. 

Many of the articles stressed technique rather than specific implementation, which speaks 
for the sophistication of the readers. As the year progressed, readers were able to adapt tech¬ 
niques and examples to their particular hardware system requirements. Specific applications 
articles stressed the algorithmic aspect more than in the past. (For example, see Richard 
Emerson’s “Shorter Printer Driver for PolyMorphic BASIC.” The article gives a specific appli¬ 
cation, and gives the reader introduction to the concept of circular buffers. J.M. Terry offers 
an equally informative discussion of the basics of list processing; Mike Gabrielson gives a clear 
and entertaining look at “Binary Tree Manipulation.”) 

Reader debates ranged from controversies over hex versus octal notation to the relative 
merits of languages. Follow, for example, the lively exchanges between the proponents of 
FORTH and STRUBAL to get the flavor of discussion. 

By the end of 1978, it was apparent that small computers could have as great an effect on 
human society as printing has had. A tremendous base of knowledge for computers had been 
established. Industry gurus were losing sleep trying to predict where it was all going to lead. 

And where will it lead? 

Among the effects the microcomputer will have on our world will be a profound increase 
in the volume and quantity of communication. When small computers are linked by means of 
satellites to other computers as well as to large data bases, the world will see an information 
revolution before which the invention of printing will pale. That day has been brought closer 
by the readers and contributors of Dr Dobb’s. 


Tom Williams 
Editor, Volume III 



Contents 


VOLUME 3, NUMBER 1, 1978 


13 

14 

15 

16 
18 
20 
28 
48 


The Heath H-8 “Evaluation”: I Think We Blew It! 
Memory Test for 6502 Carl Moser 
Consarn That H-8! Craig A. Pearce 
Challenging Challenger’s ROMs Stephen P. Smith 
Is Your Assembly Language Program Well Structured? 
ISIS: Anatomy of a Real-World Operating System 
The SAM76 Language Ancelme Roichel 
An 8080 Disassembler & Support Software for SOL 


Jim C. Warren, Jr., Editor 


Webb Simmons 
Perry C. Hutchison 

Don Van Dyke 


VOLUME 3, NUMBER 2, 1978 


60 ET TU, KLATU? Stanford News Service 

61 Decoding Efficiency & Speed: Pros & Cons of Table Look-up H.T. Gordon 
64 MITS 4.0/4.1 BASIC Searcher/Patcher James Monagan 

66 A Simple Technique for Static Relocation of Absolute Machine Code 
Gary A. Kildall 

70 Relocation is Not Just Moving Programs Richard L. Roth 
78 Absolutely Dazzling Dazzleware Gordon French & Gregory Yob 
86 Dazzler Driver Subroutine and a “Chase” Phillip Simpson 

98 Z-80 RAM Tester John MacDougall 

99 Mini Editor for 8080 PILOT Tim Scully 

101 The Last Rehash of Beau Hex? letters in the unending(?) hex/octal debate 


VOLUME 3, NUMBER 3, 1978 


106 Renumbering and Appending BASIC Programs on the Apple-II Computer 

Steve Wozniak 

112 STRUBAL: A Structured BASIC Compiler Robert Grappel 

113 A Z-80 Tracer Arthur W. Cline 

115 A KIM Binary Calculator John Eaton 
118 Status of the UCSD PASCAL Project Kenneth Bowles 
122 ACT — An 8080 Macroprocessor — Part I Alex Cecil 
148 SAM 76 — Additional Comments Ancelme Roichel 






VOLUME 3, NUMBER 4, 1978 


152 List Processing Unravelled: Pointers, Chains, Rings and Trees J.M. Terry 

157 The Oznaki “Life” Harvey A. Cohen 

159 AIK Debugger for the Z-80 Les Hancock 

166 Exit This Reviewer Jef Raskin 

169 A Line-Oriented PILOT Editor David J. Morgan 

174 ACT—An 8080 Macroprocessor — Part II Alex Cecil 


VOLUME 3, NUMBER 5, 1978 


198 Programming Language Translation Techniques W. M. McKeeman 

211 Yet Another Body Ken Anderson 

215 FORTH for Microcomputers John James 

222 Resident Memory Test Systems Terry Ritter 

228 EDITH A: A Revision of the Fylstra KIM -1 Editor Program H.T. Gordon 
234 Proposed Standard for the S-100 Bus George Morrow and Howard Fullmer 


VOLUME 3, NUMBER 6, 1978 


244 Intelligent Terminal Implementation on the S-100 Bus Tim Pugh 
257 Autodump Richard Emerson 

263 High-Speed Cassette I/O for the KIM-1 Theodore E. Bridge 

267 The Zilog Z-8 U.R. Source 

270 LAZARUS Andrew Hertzfeld 

273 A Tiny BASIC Extensions Package Leor Zolman 


VOLUME 3, NUMBER 7, 1978 


290 A Compact 8080 Disassembler & Dumper Richard Greenlaw 

305 The Intel 8086 Mike Gabrielson 

308 A IK Utilities Package for the Z-80 Les Hancock 

313 A Shorter Printer Driver for PolyMorphic’s BASIC Richard B. Emerson 

317 Fast Cassette Interface for the 6502 Carl Moser 

320 A BASIC Renumbering Program John B. Trenholme 

328 Custom File Routines for ALS-8 Larry A. Marek 

332 Common PILOT: Progress Report Larry Kheriaty and George Gerhold 


VOLUME3, NUMBER 8, 1978 


338 

354 

358 

360 

364 

367 

372 

376 


EM8080: An 8080 Emulator for 6800 Systems Gary Gaugler 

The Last of the First Aubrey Dahl 

Lisp for the 6800 Fritz van der Wateren 

FORTH Dump Programs John James 

Making a New Case for the H-9 Terminal Howard L. Nurse 

A Programmable IC Tester for KIM Joel Swank 

Dumping Northstar Disk Files Titus Purdin 

Vocal Memory Dump Phil Mork 


i 











V0LUME3, NUMBER 9, 1978 


386 LEDIP: A KIM/6502 Line Editor Kiumi Akingbehin 

395 Quick and Dirty Routines for BASIC Dennis Allison 

398 The Digicast™ Project Jim Warren 

400 POW: An 8080‘Processor of Words’ Herman Watson 

412 Data-Boy™ Speech Processor James Anderson 

416 Whatis: An 8080 Expression Evaluator Mike Gabrielson 


VOLUME3, NUMBER 10, 1978 


429 A LISP interpreter for the 8080 Darrel Van Buer 

437 Curve-Fitting Using a Focal Interpreter on the KIM-1 Theodore E. Bridge 

440 Binary Tree Manipulation on the 8080 Mike Gabrielson 

443 Programming Languages and Standards David Chapman 

444 SAM-76 Language Update Ancelme Roichel 

447 The Heath H-8 System Tom Williams 

451 BASEX: A Fast, Compact Interactive Compiler Paul K. Warme 
457 Tiny GRAFIX for Tiny BASIC Joel Swank 
459 The STD Bus Keith Britton 

465 Copying a Diskette on Intel Double Density DOS Paul M. Julich 
474 Index to Volumes One, Two, and Three 




About 

People’s Computer Company 

People’s Computer Company was founded in 1972 to demystify computers by teaching 
people how to use them. It is still carrying on that crusade through magazines, books and 
informal classes. 

As one of PCC’s founders, Bob Albrecht explained in the first issue of the PCC newspaper, 
“Computers are mostly used against people instead of for people, used to control people in¬ 
stead of to free them. It’s time to change all that. We need a People’s Computer Company.” 

Since then, in its role as a non-profit, educational corporation, PCC has published a news¬ 
paper, three magazines, and several books on home/personal computing. The Personal Com¬ 
puter NETwork, (PCNET) joined People’s Computer Company in March, 1979. PCNET is a 
Bay Area, California group dedicated since 1977 to the development of personal computer- 
based telecommunications. Computertown, U.S.A.!, a computer literacy project joined People’s 
Computer Company in August, 1979. In the past PCC also operated a neighborhood computer 
center, and a mail-order bookstore. 

Today, the PCC magazines — Recreational Computing, Dr. Dobb’s Journal, and Computer 
Music Journal — have a combined circulation of about 28,000 (paid subscribers plus news¬ 
stand sales). 

People’s Computer Company sprang from the same roots as the Whole Earth Catalog. 

Both were offshoots of the Portola Institute of Menlo Park, an organization dedicated to invest¬ 
igating and promoting the idea of alternative technology. For the founders of PCC, that meant 
learning to use computers as a liberating force in society. 

In PCC’s view, familiarity with computers breeds confidence and personal power. “The com¬ 
puter-liberated kid grows up to be an adult unafraid to challenge his bills — or anything else 
in the world’s great electronic system,” says Albrecht. 

People’s Computer Company publishes three magazines for three distinct audiences. The 
oldest, Recreational Computing, is for the computer novice to the intermediate hobbyist. It 
started out as a newspaper called People’s Computer Company, evolved into People’s Com¬ 
puters magazine, and took its present name with the January-February 1979 issue. The maga¬ 
zine is published bimonthly. 

“It’s in the home—in a relaxed, recreational environment—that the real computer revolution 
is going to take place over the next few years,” said Albrecht. 

As the first publication in the personal computing field, Recreational Computing has 
spawned imitators. “But we feel we have a very special niche,” says publisher Willard Holden. 
“Recreational Computing takes risks that other publications don’t. We are willing to publish 
articles that may be off-beat and outrageous if we think they will get people excited about the 
possibilities of computers.” 

Dr. Dobb’s Journal, PCC’s second publication, had its beginning in January 1976 as a short¬ 
term mimeographed forum for the newly written Tiny Basic language. Reader response was so 
strong that the Journal went into steady publication. Most DDJ readers describe themselves as 
having from intermediate to extensive computer experience. 

Dr. Dobb’s Journal is a reference journal read worldwide. Ten percent of the circulation is 
outside the United States. The magazine contains sophisticated discussions of programming 
techniques and hardware modifications. About half of each issue is devoted to free software. 
DDJ appears ten times a year. 

Computer Music Journal, the third PCC publication, is at the forefront of new developments 
in the computer music world. During the past 20 years, there has been extensive research in 
applying computers to music. The results of this research are becoming more visible as digital 
techniques transform music production, music analysis, and music recording. 

Computer Music Journal, published since 1977, is a respected source for information in this 
field. The Journal is distributed quarterly to universities, research institutes, and individual 
subscribers in 27 countries. 

People’s Computer Company occupies the second floor of a small office building in down¬ 
town Menlo Park. The 30 staff members, more than half of whom are part-time, have pro¬ 
fessional interests in education, art, musical composition, computer science and journalism. 

People’s Computer Company 
Box E 

Menlo Park, CA 94025 




dr. dobbs journal of 


COMPUTER 


C 


alisthenics 


60 


rthodontia 


Running Light Without Overbyte 


Number 21 


Box E, Menlo Park, CA 94025 


Volume 3, Issue 1 


A REFERENCE JOURNAL FOR USERS OF HOME COMPUTERS 


Heath's H-8 

The Heath H-8 “Evaluation”: 1 Think We Blew It! — Jim C. Warren, Jr., Editor 3 

Consam That H-8! — Craig A. Pearce 5 

a tongue-in-cheek scolding of DDJ 


6502 Stuff 

Memory Test for 6502 - Carl Moser 4 

Challenging Challenger’s ROMs - Stephen P. Smith 6 

Software Design & Implementations 

Is Your Assembly Language Program Well Structured? — Webb Simmons 8 

ISIS: Anatomy of a Real-World Operating System — Perry C. Hutchison 10 

an "internal logic manual” for Intel's ISIS 

The SAM76 Language — Ancelme Roichel 18 

complete documentation of a powerful string & macro processor 
An 8080 Disassembler & Support Software for SOL — Don Van Dyke 


38 





© David Dameron 1979 


•5 





















THE HEATH H-8 “EVALUATION”: 

I THINK WE BLEW IT! 

Jim C. Warren, Jr., Editor, DDJ 

In issue 19 of Dr. Dobb’s, we published a rather negative 
evaluation (?) of Heath’s H-8, along with a detailed 
response from Heath. The evaluation was written by a 
person we know personally whose technical judgment has 
proven to be fair and accurate in the past. At his request, 
we withheld his identity from publication—an editorial 
policy that is quite common among periodicals ... at least, 
regarding “Letters to the Editor.” 

In retrospect, it is beginning to appear that we were 
wrong on several counts. 

(1) . If we were going to publish an article, giving it the 
strength of being a DDJ “evaluation”, then we should 
have identified the author. While it may be appropriate to 
withhold a writer’s identity when publishing a letter to 
the editor, we have concluded that authors of articles— 
and certainly of product evaluations—should be identified, 
and we will do so in the future. 

(2) . We have been receiving additional feedback from 
other H-8 consumers, and have found it to be explicitly 
contradictory to a number of complaints in the original 
article we published. We have been publishing and will 
continue to publish such follow-up information. 

(3) . We currently have, in-house, an H-8 kit shipped to 
us by Heath for evaluation. Tom Williams, our Associate 
Editor, is currently in the process of constructing it and 
has already found a number of points of disagreement 
with the original negative evaluation. As soon as he finishes 
the construction and testing of the kit, we will be 
publishing his evaluation of the kit, as an evaluation per¬ 
formed by a Dr. Dobb’s Editor, in-house. 

We would like to apologize to Heath and to our readers 
for having published what is beginning to appear to have 
been an inaccurate and poorly researched “evaluation” 
of the H-8. It is no more appropriate to publish an inaccu¬ 
rate negative article concerning a product, than it is to 
publish an inaccurate article that praises a product. Articles 
are written by individuals, and evaluations require judgment 
on the part of the individual doing the writing. In this 
case, it appears that the author of the article erred in 
significant aspects of his judgment, and that we erred in 
trusting his judgment. For this, we apologize. 


RS-232 ADAPTER FOR KIM 


News Release Received: 77 Dec 20 

The ADApter converts KIM’s 20 ma. current loop port to 
an RS-232 port. ADA does not affect the baud rate and uses 
standard power supplies. The unit comes complete with 
instructions, is assembled and tested, and measures 3” x 3 VJ’ 
x 1 ”. KIM is isolated from the RS-232 device by optoisolators. 

ADA sells for $24.50 with drilled, plated through solder 
pads for all connections, or for $29.50 with barrier strips and 
screw terminals. Connecticut Microcomputer, 150 Pocono Rd, 
Brookfield, CT 06804, (203) 775 -9659. 


UNSUPPORTED OPCODE PITFALLS 

Dear Jim, Received: 78 Jan 9 

Pardon my tardiness, but when I got around to the article 
on 650X Opcodes (August 1977) it set off a sensitive nerve. 
In my opinion, there are no words strong enough to convey 
an adequate warning against investing any significant time and 
effort in hardware or software that is either irreplaceable or 
not yours to use. 

Before you use unsupported “instructions” in an MPU, 
before you buy that music board with the secret, proprietary, 
irreplaceable kludge chip, before you buy that proprietary 
computer language, ask yourself what you will do if your 
marbles get taken away. Suppose the chip blows? They do, 
you know. Suppose your supplier goes out of business? 
Suppose he merely multiplies the annual support/royalty 
charges by ten? 

My advice is to do what knowledgeable people in the 
electronics industry have usually done: unless it’s in the 
nature of a throwaway, don’t even think about buying it 
or renting it or using it unless you have a clear alternative 
if your supplier starts to behave unacceptably, or ceases to 
exist. People who disobey that injunction have been badly 
burned in the past, and will be badly burned in the future. 

So have fun with the unsupported opcodes, marvel at 
the secret kludge chips, and read about the latest super-gizmo 
proprietary packages. But don’t tie yourself too heavily to 
any of them. 

Cordially yours, 730 Witte Hall 

Paul Schick Madison, Wise. 53706 



ERROR ON MOSTEK ERRATA 

Dear Mr. Warren: Received: 78 Jan 10 

I recently received the October 1977 issue of Dr. Dobb’s 
and have found a letter entitled “MOSTEK/Zilog Flag Flap” 
which is in error and could mislead your readers. 

MOSTEK is a fully licensed second source of the Z80 chip 
set (CPU, PIO, CTC, CMA and SIO) designed by Zilog. As 
such, MOSTEK fabricates the Z80chip setfrom masks designed 
by Zilog with no problems. 

Reader Caldwell’s confusion stems from an error in our first 
printing of the MOSTEK Z80 Programming Manual. An 
ERRATA sheet has been added to successive printings of the 
manual to correct the errors and available to anyone who 
contacts us regarding this matter. 

Both the MOSTEK and Zilog Z80-CPU devices set the 
carry flag when subtraction generates a borrow. This is also 
compatible with the operation of the 8080A as the 8080A 
instruction set is a subset of the Z80 instruction set. 

MOSTEK is concerned that Caldwell’s letter in your pub¬ 
lication will mislead your readers. Therefore, we encourage 
you to print this letter and the enclosed ERRATA sheet in 
your next issue. If any of your readers have questions regard¬ 
ing this matter, feel free to contact me or any of our Field 
Applications Engineers. 

Regards, MOSTEK Corporation 

James F. Vittera P.O. Box 169 

Applications Engineering Carrollton, TX 75006 


Number 21 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 3 


13 




MEMORY TEST FOR 6502 


Dear Mr. Warren: Received: 78 Jan 3 

Enclosed is a source listing of a program which tests RAM 
memory in 6502 based systems. I wrote this test after using 
other memory test programs which did not perform a 
complete test. The problem areas were untested chip selects, 
and address line inputs. This program written in my assembler’s 
source syntax (advertised in Vol.2 No. 8 of DDJ), performs 
an exhaustive test of a user specified range of memory. The 
I/O is arranged for 6502 TIM based systems but can be easily 
changed. 

The program performs two tests: 

Test 1: Tests all memory cells for storage retention, and 
shorted data and address lines. This is done by writing: 
00 11 ... FF 00 11 . .. FF continually throughout 

the memory range for the first pass. When this has been 
written it is checked to validate the data. On the next 
pass 01 02 ... FF 00 01 ... FF is written and check¬ 
ed. This continues for 256 (hex FF) passes until all possible 
combinations of bit patterns have been used. 

Test 2: Tests the RAM chip select inputs. This is the same as 
test 1 except data 00 01 ... F2 00 01 ... F2 is used. 

Before execution, enter the address of the start of the 
memory to be tested in 00C0 (lo) and 00C1 (hi), and the end 
of memory +1 in 00C2 (lo) and 00C3 (hi). 

Execution begins at 0000 with the first test. 

If an error occurs, it will be outputted in the following 
form: 


Address Test Pattern Error 
xxxx yy zz 

When test 1 runs to completion, a break will occur and 
register A will contain El (signifying end of test 1). To exe¬ 
cute test 2, simply continue execution (type G to TIM moni¬ 
tor). 

If errors occur, they will be of the same form as described 
above. When test 1 has mn to completion, a break will 
occur and register A will contain E2 signifying the end. To 
continue execution at test 1, simply type G to the TIM 
monitor. The address range entered in 00C0—00C3 is not 
altered by the memory test program. 

If errors occurred in test 2 but not in test 1, you can safely 
assume a chip select malfunction (defective or not connected). 
Usually a number of errors will occur in test 1 when the fault 
is a single defective address input, data input, or data output. 

If a continuous sequence of addresses with errors occur, the 
problem is likely to be an open data input, or stuck at ‘1’ or 
‘0’ data output. 

If every 2nd, 4th, 8th, 16th or some power of 2 address 
sequence with errors occur, check for defective address inputs. 

If you are checking say 2102’s (1 x IK) and are specifying 
a range of, say 4K of memory, and an error common to the 
whole range occurs, the problem is likely to be in the power 
leads, defective data or address buffers, stuck at ‘0’ address 
inputs, stuck at ‘0’ data inputs, or stuck at ‘0’ data outputs. 

In all of the above, you may have to examine the various 
memory error patterns for some similarity in order to isolate 
the defective component. This is especially true of the 1 x IK 
2102 memory chip where each chip is devoted to a particular 
data lead (D 0 — D 7 ). 

Finally, since this program has a copyright assigned, I 
waive this right for publication in DDJ only.. 

Sincerely, 3239 Linda Dr. 

Carl Moser Winston-Salem, NC 27106 


0901 
000? 
300 4 
0004 

000 s 
0006 


•COPYRIGHT 1977 nr CARL Mf)SER» 
• ALL RIGHTS RESERVED. 


MCS 653? MEMORY TEST 




0007 


PROGRAM 



0009 





0000 

:USER ENTERS MEMORY TO RE TESTED STARTING 



0010 

:ADDRESS IN START* AND END ADDRESS IN ENQ. 



0011 





001? 





9013 

;these storage variaries are external in zero page. 



0014 

START 

•OE «C0 USER ENTERS START OF mem. TO HE If 



0015 

END 

•DE SC2 USER ENTERS FNO OF mfm. TO RE TES 



0015 

AD0RS 

•OE SCI 



0017 

TEST*TYPF 

•DE SC6 



0019 

TESWATRN 

•DE SC7 



0010 





0 0 ? 0 





0 0 ? 1 

: ROM I/O CALLS 



09?? 

TRY! 

• DE 17?R1 OUTPUT A PACKED RYTE (TWO DIGIT' 



00?1 

SPACE? 

.DE S 7174 OUTPUT TWO SPACES 



0 0 ?4 

CRLF 

.DE S7?RA OUTPUT A CARRIAGE RETURN* LINE f 



0025 





00?6 





09?7 


• RA S0 



00?9 



0000 

4 ?04 

0020 

MFM.TFST 

LDX *3 ffl 

000? 

9EC640 

00.10 


six tes r *type test i 

000S 

?0 1 900 

0031 


JSR TEST*PGM 

000A 

4RE1 

303? 


LOA *F 1 

0001 

00 

0033 


RRK 

000R 

E4 

0 434 


NOP 

000C 

F4 

0935 


NOP 

0000 

EEC690 

0036 


INC TEST*TYPE TEST 2 

0010 

201900 

0937 


ISR TEST*PGM 

0013 

ARE? 

0039 


LOA «E? 

0015 

99 

0930 


RRK 

001R 

E4 

9940 


NO J 

0017 

E4 

004 1 


NOP 

001R 

4C0403 

0042 


JMP MEM* TES T 



034 3 



0 419 

?09 4 7 ? 

0044 

TEST*PGM 

JSR CRLF 

00 IE 

4 4 49 

0 44 5 


LOY *93 PATTERN REGISTER 

0 0 ? 0 

4?09 

9 44 f. 


LDX *33 

002? 

9FC700 

004 7 


ST* TEST*PATRN 

00?S 

4C?E09 

9049 


IMP N<*PASS 



0940 



0029 

EEC704 

0059 

NY*PATRN 

INC TEST*PATRN 

0 4 ?H 

0991 

0051 


RNF NX*PASS 

00?D 

60 

005? 


RTS 

04? E 

ACC70P 

0353 

N < • P A S S 

LOr TFST*PATRN 

0031 

?0450« 

. 0354 


ISR 1N1♦ADORS 

00 34 

09 

0055 

LOOP1 

TY A 

00 35 

9 1C4 

0056 


STA (ADDRS.Y) STORE PATTERN 

0037 

C1C4 

0957 


CMP ( ADDRS*Y) CHECK 

0039 

F 30 3 

0359 


RED N0*ERR1 

0939 

?09513 

0050 


JSR ERROR ADDRS* R ( A)• (ADORS.X) 

043E 

20SE49 

9063 

N0*ERR1 

JSR 1NC* A ODRSC 

0411 

F305 

0061 


RET CK*PA TRN 

4 04 3 

296190 

9 06? 


JSR INC*RY 

3 04 6 

4 C 34 0 9 

0063 


JMP LOOP 1 



0061 



0049 

4CC700 

0065 

CK*PATRN 

LOY TEST**MTRN 

994 C 

?04509 

0966 


ISR 1Nl♦ADDRS INITIALIZE ADDRS 

034E 

09 

0367 

LOOP? 

TYA 

0959 

C1C4 

00F9 


CMP (ADDRS.X) 

90S? 

F 9 4 3 

0060 


RED ND*ERR3 

0054 

?.MS30 

39 70 


JSR ERROR ADDRS* R(A)* (49DRS*X) 

0957 

?06 1(49 

00 7 1 

no* err ? 

JSR INC*RY 

0054 

? 0 6 F 0 '4 

917? 


JSR 1 NC* ADDRSC 

0050 

D0F0 

037.3 


RNF LOOP? 

005F 

F0C7 

0371 


RED NX*PATRN 



30 75 





3076 



9051 

C9 

0077 

1NC*RY 

1 NY 

405? 

4OC500 

9379 


LOA TF$T*TYPF 

4055 

F036 

0070 


RED E< 1 T1 

0057 

C0F 3 

9090 


CP Y *F1 RESET R(y ) TO CHECK CHIP SELECTS 

0051 

000? 

039 1 


RCC E<lTl 

4059 

4?i40 

009? 


LOY *00 

4060 

69 

0093 

E* i r i 

RTS 



0094 





0395 



04RE 

EFC490 

0096 

1NC* 40DHSC 

INC ADDRS 

09 7 1 

0 001 

0397 


HNE SKI«*m| 

49 7 1 

EEC509 

0991 


INC ADDRS**31 

03 75 

ADC ?09 

0390 

SK1P♦HI 

LOA ENO 

90 79 

CDC440 

3000 


CMP ADORS 

047C 

0006 

9901 


RN 6 EXIT? 

407E 

ADC 109 

000? 


LOA FND.S31 

399 1 

CDC590 

3001 


CMP 4D0RS*«91 

0394 

60 

0004 

E* 1 T? 

P T 5 



3006 





0006 





9007 

•OUTPUT ThF ERROR: ADDRESS* PATTERN* ERROR 

00RC 

49 

00OO 

ERROR 

PMA 

4095 

4OC500 

0000 


LDA A0DRS*«91 

3090 

?0917? 

0100 


JSR TR»T OUTPUT ADDRS h| 

0 99 C 

4 DC 4 3 4 

0101 


LOA ADDRS 

309E 

?3R17? 

0 10? 


ISR T B Y T OUTPUT ADDRS LO 

000? 

?0 7 4 7 

0133 


ISR SPACE? 

4915 

69 

0104 


PI A 

9005 

? 71=41 7? 

3195 


JSR TRYT OUTPUT PATTERN 

?0RR 

237471 

3106 


ISR SPACE? 

00OC 

A1C4 

3107 


L D A (ADDRS.X) 

P99E 

?09 1 7 ? 

9109 


JSR TRYT OUTPUT ERROR IN MPMORY 

0001 

?40A 7? 

31.10 


JSR CRLF 

(1414 

69 

0113 


RTS 



3111 





311? 





3111 

INITlALIZE 

ADDRS WITH START 

0045 

AOC400 

0114 

INI* 40DRS 

LPA START 

0049 

9OC400 

3115 


STA ADORS 

0049 

AQC100 

0116 


LOA START.H31 

40 4 E 

9 D C 5 0 9 

3117 


STA ADDRS**'* 1 

0091 

50 

0119 


RTS 


0119 
0 1 ?0 


Page 4 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 21 







CONSARN THAT H-8! 

Dear Sirs: Received: 78 Jan 12 

I truly enjoyed the article by . . . hmmm . . . let’s see . . . 
no name given, eh? Well, anyway, the article by (must be) 
Dr. Dobbs (or maybe Dr. Duds) himself on the great review of 
the Heath H8 microcomputer. Fantastic! What a swell job 
of reviewing. The author really got to the point. You tell ’em 
Doc. 

The H8 HAS to be the worst 8080A microcomputer out. 
Mine, running with 24K at the moment, actually runs correct¬ 
ly when switched on! No self respecting home computer 
should do that. It even had the audacity to come up running 
immediately after I completed building it! What will all the 
tinkerers do with a system that actually runs ? 

Unlike the original S-100 bus system I first built, the 
H8 can’t destroy memory contents when a reset is performed. 
The damn thing keeps preserving what is in RAM. Further¬ 
more, if you can believe it, this poor machine doesn’t even 
let the novice write his own bootstrap program to use the 
cassette interface .. . one is already in ROM ready to use for 
loading or dumping. Some spoil sports these Heath people 
are, aren’t they? 

That angle rack mounting is really bad. Here, the boards 
are rigidly secured on top, bottom and side, making this 
excuse for a computer simple to transport, rather than having 
the fun of stuffing newspaper or packing ‘pop-corn’ in so the 
boards don’t snap off like some S-100 Systems. Since the 
mounting bracket on each board also acts as a heat sink, the 
fact that they are attached to the computer main frame can 
dissipate the heat even better, and thus, you don’t have the 
fun of leaving the top off the computer like on other 
systems, nor the sheer pleasure of the fan constantly running 
in your ears, since none is needed. 

I was able to fix the problem of not enough stuff on the 
boards that Doc brings up too. (After all, what fun is having 
a circuit board made simple, with fewer parts to go wrong, 
when a jumbled up board, taking three times as long to build is 
much more impressive looking ... even if it doesn’t work.) 
I just glued extra ICs on the board indiscriminately to make 
things more complex! 

At least ol’ Doc, the author of this H8 review, had enough 
sense to leave off the metal clip supplied with the H8 (to be 
placed by the keys mounted on the circuit board) so that his 
board bends as the keys are hit. I, like a fool, followed the 
Heath directions and put the clip on, which totally avoided the 
problem of the bending board Doc points out in his article. 
As soon as I finish this letter, I intend to immediately run up 
and pull the clip off my machine so I can bend my front panel 
board too! 

Oh yes, and then there is that God awful OCTAL! My 
Lord, what a sin! It takes someone almost 10 minutes to get 
used to a new numbering system. I wish I were as lucky as 
Doc, and have 8 thumbs on each hand so I could use Hexadeci¬ 
mal too. 

The fact that you can monitor, both dynamically, as well 
as statically any register, memory location or I/O port via 
the front panel too is also a hardship. I’d much rather have 
a string of LED lights to view and interpret. Or better yet, 
no front panel at all, like the SOL or APPLE II. Where’s the 
challenge in seeing what you’re doing? 

I guess what’s really horrible, as Doc points out, is the fact 
that there is no compatibility with existing S-100 cards. 
No one is going to make H8 compatible cards (excusing the 
already announced Godbout 12K RAM card, or some other 
manufacturers who have also requested to manufacture H8 
compatible cards). I mean, outside of them, there’s only 
Heath. 


By all means, Heath has really gone too far with the H8. 
Swelled heads and too big for their britches, as Doc says. 
They actually had the nerve to offer the typical hobbyist and 
home user a microcomputer that actually works, has a 
functional and useful front panel, compatible software, 
memory boards that hold their contents rather than dropping 
bits, I/O boards that operate correctly the first time they are 
built, solid construction and a design that isn’t a rehash of all 
the other hardware on the market today. Damn innovaters... 
next thing you know, someone may offer documentation that 
isn’t 10 mimeographed sheets (like a lot of other systems) and 
give full support like the H8 documentation. 

Do your readers know that the Heath people are actually 
giving you software in the form of Basic, console debug, 
text editor and assembler with the computer to get the user 
going faster? Where’s that good old “We’ll get ’em on the 
accessories!” rule that has become a standard in the industry? 
The people at Heath even returned my phone calls on some 
questions I had about the system; with right answers even! 
Now what kind of computer manufacturer is that, that 
actually RETURNS the users’ calls, with correct answers to 
boot? No one else that I can think of. 

And, I can see Doc’s dislike of the fact that only the Heath 
part numbers are given on the schematics. Why make it easy 
for the non-technician to order parts through Heath when 
needed? Besides, I guess Doc has the same problem I have of 
not knowing how to use the cross reference table in the 
manual (each has one), which gives the user the standard, 
industrial part number. Hell, you have to know how to match 
up numbers to use a table like that! 

Finally, I have personally gained some special knowledge 
in writing styles. I am the author of the Microscene column in 
65-Notes, a newsletter put out by the HP-65 Users Club (not 
affiliated with Hewlett-Packard), which is read by some 1900 
members. When I ran a poor review of a micro, I was actually 
dumb enough to sign my name. I’ve learned now. This may 
well be my last time I’ll sign any of my work that might bring 
me criticism. 

Let’s hope that Heath can do better next time, in producing 
a piece of hardware that constantly requires revisions like the 
other micro manufacturers, (with their various patches and 
fixes). And, by all means, Mr. Warren, Jr., keep a high regard 
for the author of this fine review, ol Doc Duds. He’s really 
the best. 

Oh, one more thing, Mr. Warren ... if you should find this 
little note of some interest, please print it in the letters 
column, rather than give it to “Doc Duds”. At least those 
who subscribe to your magazine can read. 

Sincerely, 2529 S. Home Avenue 

Mr. Craig A. Pearce Berwyn, Illinois 60402 


Conclusion of "Memory Test for the 6502" 


14REI FILE: [ / = E*TFRN4l 3 


/ST4»T = (1«CH 
/TFSTMYPE = <*flC« 
/SP4CE?=7374 
TEST*PGM=a«nR 
L OOP 1 = f*P 34 
LOOP? = *)04F 
FX I T 1=20FD 
EX I 12 = 0084 
END*PG* = 0»R2 


/FND=0PC? 
/TFST*P4TR N=fl0C7 
/CPLF=7?8A 
NX*P4TRN = i*fl?R 
NO*F8R1=003F 
NO*FR9?=0057 
I *JC*4DDRSC = (?08E 
ERROP=0*85 


/4008S = f»«C4 
/rnrT=7?Rl 
VF M * TEST = 008 A 
NX»P4SS=002E 
CK*P4TRN=flfl49 
INORY=0Pfi1 
SKIP*HI=G37fi 
IM*400RS=85I4S 


Number 21 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 5 


15 



CHALLENGING CHALLENGER’S ROMS 

Dear Friends, Received: 77 Dec 28 

I have just become the proud owner of an Ohio Scientific 
Challenger with Basic in 8K of ROM and a monitor in V£K of 
PROM. While I am delighted with its performance, I’m not 
happy about the lack of documentation provided for the read 
only memory. I’d like to use the utility routines which must 
be buried there. 

I tried hand decoding memory dumps, but that’s a labor¬ 
ious task. Then it occured to me to let Basic do the work for 
me. Using the PEEK function, I wrote a disassembler to 
convert the stored bytes into MOS Technology cross assembler 
mnemonics and decimal operands. The monitor decoded 
easily, revealing a basket of I/O goodies. The Basic ROMs 
are yielding more slowly. They apparently contain a number 
of tables which must be picked around carefully. 

I’ve enclosed a copy of my program so that other 6502 
users can reap the same benefits. It’s written, of course, in 
OSI’s Microsoft Basic, but should be adaptable for PET 
and Apple. I haven’t time to pursue refinements such as hex 
conversion for addresses, recognition' of ASCII characters, 
or automatic skips around tables. If another reader makes 
these or other additions, I’d appreciate them sending me 
a copy of the program. 

Sincerely yours, P.O. Box 841 

Stephen P. Smith Parksley, VA 23421 


GOODIES FROM THE GOVERNMENT?? 

Dear Dr. Dobbs, Received: 77 Dec 29 

Your readers might be interested in a government sponsored 
software library. The National Aeronautics and Space Admin¬ 
istration (NASA) puts out a quarterly journal “Computer 
Program Abstracts” which can be ordered from the Superin¬ 
tendent of Documents, U.S. Government Printing Office, 
Washington DC, 20402 for $3.30/yr. 

Be aware that most of the programs are of little use to the 
average home computer freak. Not too many need a 4,062 
line FORTRAN IV program for $480 to “calculate flow fields 
in supersonic inlets”. But useful items do surface; like a 79 
line BASIC program for “organizing and managing a collection 
of articles dealing with a specific keyword or subject”; 
program and documentation for $25. The programs are writ¬ 
ten for everything from IBM 370’s to HP-25’s. Costs range 
from $15 to $2,500 with separate documentation running at 
5 to 10 percent of the program price. If the documentation 
meets the usual government specifications, it will be very 
complete. 

To sum up, the prices for this software are such that if you 
find what you need here and you have a market for its services, 
the government software would be a bargain. 

Ronald N. Orr 
1114 Harper Ave 
Redondo Beach, CA 90278 


LIST 

ID PRINT "DISASSEMBLER FOR MOS TECHNOLOGY 650X" 

20 PRINT "BY STEPHEN P. SMITH, PARKSLEY, VA 

21 PRINT "VERSION 1.0, DECEMBER 13,1977 

22 PRINT 

30 DIM Nl(56),A(296),LS(3),T$(5) 

40 DATA ADC,AND,ASL,BCC,BCS,8EQ,B1T,BM1,8NE,BPL,BKK,BVC,BVS,CLC,CLD 
50 DATA CLI,CLV,CMP,CPX,CPY,DEC,DEX,DEY,E0R,INC,INX,I NY,JMP,JSR,LDA 
60 DATA LDX,LDY,LSR,NOP,0RA,PHA,PHP,PLA,PLP,R0L,RTI,RTS,SBC,SEC ,SED 
70 0ATA SEI,STA,STX,STY,TAX,TAY,TSX,TXA,TXS,TYA,ILLEGAL 
80 FOR 1=1 TO 56 
90 READ NS(1) 

100 NEXT I 
110 LS(0)=" " 

120 LS(1)="#" 

130 LS(2)="<" 

140 L$<3)=" A" 

150 TS(0)=" " 

160 T$(I)=",X)" 

170 TS(2)="),Y" 

180 TSC3)=",X" 

190 T$(4)=",Y" 

200 TS(5)=")" 

201 REM 

202 REM EACH POSSIBLE V0RD IS ASSIGNED A FIVE DIGIT CODE 

203 REM THE FIRST TWO DIGITS GIVE THE APPLICABLE MNEMONIC 

204 REM THE THIRD GIVES THE TOTAL NUMBER OF BYTES IN THE INSTRUCTION 

205 REM THE FORTH INDICATES WHICH OF 4 LEADING FIGURES IS TO BE PRINTED 

207 REM THE FIFTH INDICATES WHICH OF 6 TRAILING FIGURES IS USED 

208 REM 

210 DATA 11100,35221,56100,56130,56100,35200, 3200,56100 
220 DATA 37100,35210, 3130,56130,56100,35300, 3300,96100 
230 DATA 13200,35222,56130,56100,56100,35203,56100,56100 
240 DATA 14100,35304, 3203,56100,56100,35303, 3303,56130 
250 DATA 29300, 2221,56100,56100, 7200, 2200,56100,56100 
260 DATA 39100, 2210,56100,56100, 7300, 2300,56100,56100 
270 DATA 8200, 2222,56130,56100,56100, 2203,56100,56100 
280 DATA 44100, 2304,56100,56100,56100, 2303,56100,56100 
290 DATA 41100,24221,56100,56100,56100,24200,33200,56100 
300 DATA 36100,24210,33130,56130,28300,24300,56100,56100 
310 DATA 12200,24222,56100,56100,56100,24203,33300,56100 
320 DATA 16100,24304,33203,56100,56100,24303,33300,56100 
330 DATA 42100, 1221,56100,56100,56100, 1200,56100,56100 

340 DATA 38100, 1210,56100,56100,28325, 1300,56100,56100 

350 DATA 13200, 1222,56100,56100,56100, 1203,56100,56100 

360 DATA 46100, 1304,56100,56100,56100, 1303,56100,56100 

370 DATA 56100,47221,56100,56100,49200,47200,48200,56100 


380 

DATA 

23100,47210,53100,56100,49303,47300,48300,56100 

7 65024, 

65047 


390 

DATA 

4200,47222,56100,56100,49200,47203,48204,56100 

65024 

LDA 

64512 

400 

DATA 

55100,47304,54100,56100,56100,47303,56100,56100 

65027 

LSR 

A 

410 

DATA 

32210,30221,31210,56100,32200,30200,31200,56100 

65028 

BCC 

-4 

420 

DATA 

51100,30210,50100,56100,32300,30300,31300,56100 

65030 

LDA 

64513 

430 

DATA 

5200,30222,56100,56100,32203,30203,31204,56100 

65033 

AND 

# 127 

440 

DATA 

17130,30304,52100,56100,32303,30303,31304,56100 

6503 5 

PHA 


4 50 

DATA 

20210,18221,56100,56100,20200,18200,21200,56100 

65036 

LDA 

64512 

460 

DATA 

27100,18210,22100,56100,20300,18300.21300,56100 

65039 

LSR 

A 

470 

DATA 

9200,18222,56100,56100,56100,13203,21203,56100 

65040 

LSR 

A 

480 

DATA 

15100,18304,56100,56100,56100,18303,21303,56100 

65041 

BCC 

-5 

490 

DATA 

19213,43221,56100,56100,19200,43200,25200,56100 

65043 

PLA 


500 

DATA 

26100,43210,34100,56100,19300,43300,25300,56100 

65044 

STA 

64513 

510 

DATA 

06200,43222,56100,56100,56100,43203,25203,56100 




520 

DATA 

45100,43304,56100,56100,56100,43302,25303,56100 




530 

FOR 

1=1 TO 256 

BREAK IN 

940 


540 

READ 

A (I) 

OK 




550 NEXT I 

560 PRINT "ENTER STARTING AND ENDING ADDRESSES" 

570 INPUT S,E 

580 REM BEGIN DISASSEMBLY 

600 I=PEEK(S) 

605 REM LOCATE AND DISMEMBER THE 5 DIGIT CODE 
610 C = A(1+1) 

620 M=INT(C/1000) 

630 IF M=56 THEN 1000 

631 IF M«1 THEN 1000 
640 8 = 1NT(C/100)-M*10 

650 P=1NT(C/10)-M*I00-8*10 

660 Q=C-M*I000-D*100-P*ID 

670 IF 8=1 THEN 800 

675 REM SECOND BYTE OF INSTRUCTION 

680 01=PEEK(S+1) 

690 IF B=2 THEN 800 

695 REM THIRD BYTE OF INSTRUCTION 

700 D2=PEEK (S+2) 

710 DI=D1+D2*256 

720 REM SPECIAL TREATMENT IF BRANCH 

800 IF M*4 THEN 900 

810 IF M*13 THEN 900 

820 IF DI«127 THEN 900 

830 D1=-<254-D1) 

900 PRINT S|TAB(10)|NS(M)|TAB(16)jLS(P); 

902 IF D1=-123456 THEN 908 
904 PRINT D1;T$(Q)| 

908 D1=-123456 

909 PRINT 

910 S=S+B 

911 REM NEXT INSTRUCTION 
920 IF S«E THEN 600 

930 PRINT TAB(30),"**♦*♦*****" 

940 STOP 

1000 PRINT "AT"|Sj" ";Ij" IS NOT A VALID OPCODE" 
1010 PRINT "TERMINATING DISASSEMBLY" 

1020 END 
OK 
RUN 

DISASSEMBLER FOR MOS TECHNOLOGY 650X 
BY STEPHEN P. SMITH, PARKSLEY, VA 
VERSION 1.0, DECEMBER 13,1977 

ENTER STARTING AND ENDING ADDRESSES 


********** 


Page 6 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 21 


16 



CONSUMER DO’s AND DON’T’s FROM A DEALER 

Dear Dr. Dobb’s, Received: 78 Jan 9 

I read with interest the article, “A Detailed Report on 
Product Delivery ”in the last issue (Volume 2 Issue 9) of DDJ. 
I thought that a few comments and suggestions from a com¬ 
puter dealer (we operate a retail computer outlet as part of 
our business in Northern Florida) may be of interest to you 
and your readers. 

1) If at all possible, purchase products directly from a 
local computer store in your area. Not only does this 
permit you to see the merchandise working before you 
buy it, but many times you can get it the very same 
day you decide you want it. Additionally, if you have 
problems, you will have somewhere to go. Unfortu¬ 
nately, many manufacturers give you the instant “well, 
you’d better send it back” routine (ie, 2—8 weeks 
delay) when you phone them. 

2) If at all possible, DO NOT send the full amount in 
advance for an item (ESPECIALLY for a new item)! 
In my opinion, the MOST that a firm should ask in 
advance is 25%. COD can be somewhat of a fail-safe 
device, but unfortunately, not all firms will ship on 
a COD basis. When a firm refuses to ship COD, it 
makes me wonder... however, a non-COD policy 
does not mean that a firm is not honest. CCD seems 
to be the best way to go when purchasing a newly 
introduced item from a new company. 

3) If it sounds too good to be true in the ad, it probably 
is (too good to be true). BEWARE!! Just becaase there 
is a photo of an item in an advertisement, that in no 
way means that that item is being produced or has 
ever even existed! The big ad does not make a firm 
reputable. 

4) When ordering by mail, request that the finn imme¬ 
diately confirm receipt of your order by mail (you 
might even include a postage-paid postcard for the 
company to return to you) and also request an expect¬ 
ed shipping date. This eliminates the “we never re¬ 
ceived your order routine” that could crop up on 
a long overdue shipment. You might also want to 
invest in a long distance phone call and inquire as to 
delivery times BEFORE you place an order and send 
money. 

5) If a firm is promising and not delivering (especially 
if they have your money) do not hesitate to bug 
and bother them with letters and phone calls. Many 
times it is the person who yells the longest and loudest 
that gets what he’s after. Do not hesitate to tell the 
overdue or non-producing firm that you ar; writing 
to several computer-related publications (ie, Dr. 
Dobb’s , Byte, Kilobaud, Interface Age, etc.) and 
advising them of your plight. It won’t make you a 
friend of the company you are dealing with, but then 
do you really want friends who take your money, 
promise, and not deliver? 

One final comment: I find unacceptable the statements in 
the above mentioned article concerning the supposition that 
it takes too much paperwork to notify customers of order 
confirmations and delays. As far as I am concerned, it is an 
OBLIGATION of a firm to notify customers of sny delay 
beyond a stated delivery date. That’s not a public relations 
add-on, it is just good business. 

Sincerely, 2062 Liberty Street 

Bobby Williams Jacksonville, FL 32206 


S-100 PRO & CON CENSUS 

Dr. Dobb’s, Received: 78 Jan 4 

Read with interest ‘The Heath H-8: Pro & Con’. The Con 
author’s first evaluation (?) point was that the H-8 is not S-100 
compatible. My first negative point would be that it is not 
Z-80 based. As far as the bus structure not being S-100, well 
that is still an open question. 

The Pro author’s comments about the S-100 are just as 
emotional as the Con author’s criticism of the H-8. And all 
along I thought this hobby was basically logical (l’s and 0’s 
and that sort of thing). Someone even told me that program¬ 
ming forces one to disciplined thinking. 

My main rebuttal to the Pro author is that “you will find 
that over 95% of them (S-100 boards) are memory cards of 
some configuration.” My count was in decimal—not octal or 
hex, so the following could be inaccurate. 

From R.E. Purser’s list of S-100 Bus Compatible Boards/ 
Systems, which has been reprinted in Interface Age and 
Creative Computing : 

Being late in the ‘eve, my count is: 


RAM memory boards 

56 

PROM memory boards 

33 

Total 

89 

Serial & Parallel I/O 


Boards 

32 

Total of both 

121 


95% of 200 (a rounded figure) is 190 memory boards. Now 
my count is not a “critical look”—just a midnight counting. 

Regarding compatibility of the S-100, the Pro author is 
right, there isn’t much beyond the basically defined pins. 
Since no one knows how much incompatibility exists, I 
decided to find out. 

The results of my labor should appear in a future issue of 
Kilobaud. I would have given it to y’all, but I had to recover 
my postage costs. 

Open question: If the majority of magazine issues are sold 
to subscribers, why are we the last to receive them (i.e. after 
the newstands)? Mailing in bulk by UPS to stores is no excuse. 
Give them to UPS a couple weeks after the subscription copies 
have been mailed. 

Pa y 

Bill Fuller 
1018F SE 8th St 
Grand Prairie, TX 75051 

Bill, your complaint is just, but we simply don’t have space 
to store the bulk issues. They do go out somewhat after the 
subscriptions are mailed but even at that we have no way of 
knowing how long the subscriber copies will spend in the Post 
Office’s aging bins before they ’re finally delivered. -TRW 


SOUTHERN CALIFORNIA DEALERS 
ASSOCIATION 

News Release Received: 78 Jan 3 

The Southern California Computer Dealers Association has 
been formed, as a non-profit corporation, covering the Santa 
Barbara to San Diego area. Membership is limited to bona- 
fide stores which sell microcomputers for personal, business, 
industrial, or educational use. 

Meetings will offer a forum for the exchange of views and 
information about the industry. The association is setting up 
committees to investigate further activities and objectives such 
as publicity for microcomputers, professional standards, and 
dealer-vendor relationships. 

For further information, contact Carl Burlin at (714)956- 
7968, or Glenn Dollar at (213) 360-2171. 

Page 7 


Number 21 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


17 



Is your assembly language program 
well structured? 


by Webb Simmons 

1559 Alcala Place 

San Diego, CA 92111 

Reprinted with permission from: 

COMPUTE Newsletter, Vol 3,#10, pp 18-19 
National Semiconductor Corp. 

There are a few simple rules that can be applied to your 
assembly language program which will show whether your 
program satisfies the more important criteria to qualify it 
as well structured in the sense of the modem buzz words on 
the matter. This presentation is intended to be practical, 
whatever that means, rather than theoretical ; therefore, I 
can make, and get away with, all sorts of idiotic statements. 

The tools you will need are an extra program listing you 
can mark up and two colored pens or pencils, say red and 
green. These pens will be used to connect program branches, 
jumps, skips, and other transfers from the transfer instructions 
themselves to the points of reference, the destinations of the 
transfers. Here we must make a nice distinction between the 
direction of the transfers so thus the two colors, red and green. 

A forward reference is defined as a transfer from a lower 
counter location to a higher numbered location. And, of 
course, a backward reference is just the opposite, a jump or 
branch from a high program counter location to a lower 
numbered location. But before we start marking, a word must 
be said about subroutine jumps. Any subroutine call or sub¬ 
routine jump that always returns to the point at which called 
(to the next executable instruction after the call) need not 
be considered to be a branch or transfer for the purposes of 
our colored markings. Fundamentally speaking,- a normal 
subroutine call is merely a glorified, super macro instruction 
more so than a formal transfer of control in the sense that is 
important from a well structured standpoint. A subroutine 
with an abnormal return upon detected error conditions, etc., 
is not a normal subroutine so the jumps to it and its returns 
must be considered as transfers to be marked. 

The first step is to use the red pen to mark all backward 
references along the side of the program listing from the 
jump instruction itself to the place jumped to. It does not 
matter but I prefer to make all of my markings on the left 
side of the listing. You should be able to draw red connecting 
lines from each backward jump to its destination with no need 
for one red line to cross another. Regardless of which side of 
the listing you choose to draw on, you must consistently use 
but one side only, left side or right side but not both sides. 
If you cannot draw the red connecting lines for backwards 
references without crossing one red line with another, you 
are already down the tubes, your program is not well 
structured. 

After passing the first test of no crossed red lines we are 
ready to mark the forward references with green connecting 
lines. A green line may cross a red line only if it is outward 
bound. If your lines are on the left, a green line can cross a 
red line when going to the left but a green line cannot cross 
a red line when going to the right. Green lines can cross 
other green lines freely, there are no restrictions on green 
versus green. Under these conditions you must connect all 
forward transfer instructions with green lines to their desti¬ 
nations. If a green line must cross a red line while inbound, 
your program is not well structured. 


What do you do if your program fails these tests? Does 
your program produce the correct results? Is it efficient in 
memory space utilization? Does it execute rapidly? These 
factors are interesting, but no matter; you must shoot 
yourself! 

Since we don’t have multi-colored printing, we are using a 
solid line in place of a red line and a broken line in place of 
a green line. 


PAGE 


48 


0000 

MS= 

0 


49 


0001 

LS= 

1 


50 

0000 

00 

SORT : 

HALT 


51 

0001 

02 


CCL 


52 

0002 

C400 


LDI 

0 

53 

0004 

FA01 


CAD 

LSI2I 

54 

0006 

CA01 


ST 

LS(2I 

55 

0008 

C400 


LDI 

0 

56 

000A 

FAOO 


CAD 

MS(2) 

57 

OOOC 

CAOO 


ST 

MS(2) 

58 



. BOTH PARTS NOW TWO’S COMPLEMENTED 

59 

000E 

C400 


LDI 

0 

60 

0010 

01 


XAE 


61 

0011 

03 

LOOP : 

SCL 4 



62 

0012 

40 


LDE 



63 

0013 

F 201 


ADD 

LS(2) 


64 

0015 

CA01 


ST 

LSI2) 


65 

0017 

06 


CSA 



66 

0018 

940B 


JP 

NOCRY1 


67 

001A 

C200 


LD 

MSI2I 


68 

001C 

F400 


ADI 

0 


69 

001E 

CAOO 


ST 

MSI2) 


70 

0020 

06 


CSA 

1 


71 

0021 

D480 


ANI 

080 


72 

0023 

9C11 


JNZ 

EXIT- t-i 


73 

0025 

40 

NOCRY1: 

LDE 4- 1 • 


74 

0026 

F201 


ADD 

LS (2) i 


75 

0028 

CA01 


ST 

LSI2) 


76 

002A 

06 


CSA 

1 


77 

002B 

9410 


JP 

NOCR Y2-1-1 


78 

002D 

C200 


LD 

MS(2) 


79 

002F 

F400 


ADI 

0 


80 

0031 

CAOO 


ST 

MS(2) 1 


81 

0033 

06 


CSA 

! 


82 

0034 

9407 


JP 

NOCRY2 — t -i 1 


83 

0036 

C601 

EXIT : 

LD 

@1(2)4-1 • J 


84 

0038 

40 


LDE 



85 

0039 

CAOO 


ST 

MS(2) 


86 

003B 

9006 


JMP 

CONT-!--r - 


87 

003D 

40 

NOCRY2 

LDE -4-i-4-l 

i 

88 

003E 

F401 


ADI 

1 

i 

89 

0040 

01 


XAE 


i 

90 

0041 

90CE 


IMP 

LOOP 


91 

0043 

00 

CONT: 

HALT 

◄- 

J 

92 


0000 


. END 



Conclusion: This program is well structured. The only 
crossing of the single red (solid) line by a green (broken) line 
is outbound, thus O.K. 

Note: Lines placed on the right rather than my preferred 
left because of more space. 


Page 8 


Dr. Dobb's Journal of Computer Calisthenics 8< Orthodontia, Box E, Menlo Park, CA 94025 


Number 21 


18 












1 


2 


3 


0001 

4 


0000 

5 


0001 

6 


0002 

7 


0003 

6 


0004 

9 


0005 

10 


0006 

11 


0007 

12 


0008 

13 


0009 

14 


0080 

15 


0010 

16 



17 



18 



19 

0001 

C470 

20 

0003 

35 

21 

0004 

C477 

22 

0006 

36 

23 

0007 

C47A 

24 

0009 

37 

25 

000A 

C46E 

26 

OOOC 

33 

27 

000D 

C400 

28 

000F 

CA02 

29 

0011 

CA03 

30 

0013 

CA08 

31 

0015 

CA09 

32 

0017 

C420 

33 



34 



35 



36 

0019 

01 

37 

001A 

C410 

38 

001C 

CA01 

39 



40 



41 



42 

001E 

C480 

43 

0020 

CAOO 

44 

0022 

C440 

45 

0024 

C980 

46 



47 



48 



49 

0026 

C11E 

50 

0028 

D40F 

51 

002A 

9C5D 

52 

002C 

BAOO 

53 

002E 

9CF6 

54 

0030 

BA01 

55 

0032 

9CE A 

56 

0034 

01 

57 

0035 

1C 

58 

0036 

9CE1 

59 

0038 

C900 

60 



61 



62 



63 

003A 

03 

64 

003B 

C4AA 

65 

003D 

8FOO 

66 

003F 

C202 

67 

0041 

ECOO 

68 

0043 

CA02 

69 

0045 

C203 

70 

0047 

ECOO 

71 

0049 

CA03 

72 

004 B 

cue 

73 

004 D 

D40F 

74 

004 F 

98E9 


Number 21 


. TITLE'CDB, REFLEX TEST - 

. -1 

CNTR1-00 
CNTR2-01 
CNTR3=02 
CNTR4=03 
DIG4=04 
DIG3=05 
DIG2=06 
DIG1=07 
DIG0=08 
DIG A=09 
COUNT1 -080 
COUNT2=010 

;START 

START: LDI 070 .SET PI 
XPAH 1 

LDI 077 ; SET P2 
XPAH 2 

LDI 07A ;SET P3 
XPAH 3 
LDI 06E 
XPAL 3 
LDI 0 

ST CNTR3I2) 

ST CNTR412) 

ST DIGOI2) 

ST DIGA12) 

LDI 020 ; SET FIRST DASH 
. DASH 

DASH: XAE < - 

LDI COUNT2 .SET CNTR 2 
ST CNTR2I2) 

; LOOP2 

LOOP2 LDI COUNT1 : SET CNTR 1 
ST CNTR 1(2) 

LDI 040 ; FIRST DASH 
ST -128(1) 

; LOOP 

LOOP: LD 01E(1) . GET KYBD <— 

ANI OF 

JNZ ERROR-- 

DLDCNTR112) . DEC CNTR 1 

JNZ LOOP - 

OLD CNTR212) : DEC CNTR 2 

JNZ LOOP2 - 

XAE ; NEXT DASH 
SR 

JNZ DASH - 

ST (1) ; BLANK DISPLY 


75 

76 

77 


CONVERT 


78 

0051 

C203 

CONVERT: LD 

79 

0053 

1C 

SR 

80 

0054 

1C 

SR 

81 

0055 

1C 

SR 

82 

0056 

1C 

SR 

83 

0057 

01 

XAE 

84 

0058 

C380 

LD -128(3) 

85 

005A 

CA04 

ST DIG4I2) 

86 

005C 

C203 

LD CNTR4I2) 

87 

005E 

D40F 

ANI OF 

88 

0060 

01 

XAE 

89 

0061 

C380 

LD -128(3) 

90 

0063 

CA05 

ST DIG3I2) 

91 

0065 

C202 

LD CNTR3I2) 

92 

0067 

1C 

SR 

93 

0068 

1C 

SR 

94 

0069 

1C 

SR 

95 

006A 

1C 

SR 

96 

006B 

01 

XAE 

97 

006C 

C380 

LD -128(3) 

98 

006E 

CA06 

ST DIG2I2) 

99 

0070 

C202 

LD CNTR3I2) 

100 

0072 

D40F 

ANI OF 

101 

0074 

01 

XAE 

102 

0075 

C380 

LD -128(3) 

103 

0077 

CA07 

ST DIG1I2) 

104 




105 



; DISPLY 

106 




107 

0079 

C404 

DISPLY: LDI 

108 

007B 

32 

XPAL 2 

109 

007C 

C420 

LDI 020 ;SET 

110 




111 



; LOOP1 

112 




113 

007 E 

01 

LOOP1 : XAE 

114 

007F 

C601 

LD @1(2) 

115 

0081 

C980 

ST -128(1) 

116 

0083 

01 

XAE 

117 

0084 

1C 

SR 

118 

0085 

9CF7 

JNZ LOOP1 

119 

0087 

90F0 

JMP DISPLY - 

120 




121 



; ERROR 

122 




123 

0089 

C479 

ERROR: LDI 

124 

008 B 

CA04 

ST DIG412) 

125 

008D 

C450 

LDI 050 

126 

008F 

CA05 

ST DIG3I2) 

127 

0091 

CA06 

ST DIG2I2) 

128 

0093 

CA08 

ST DIG0I2) 

129 

0095 

C45C 

LDI 05C 

130 

0097 

CA07 

ST DIG1(2) 

131 

0099 

C400 

LDI 0 

132 

009B 

CA09 

ST DIG A (2) 

133 

009D 

90DA 

JMP DISPLY - 

134 


0000 

. END 


GET MSD -1 


GET LSD +1 


GET LSD 


: SET P2 TO DIG 4 


SET TO LEFT DIGIT 


; SET ERROR MSG ■<— 


OOPS! 


; COUNT 

COUNT: SCL ; DEC INC CNTR 3 •* 
LDI 170 ; DELAY 
DLY 0 

LD CNTR3I2) 

DAI 0 

ST CNTR3I2) 

LD CNTR4I2) 

DAI p 

ST CNTR4I2) 

LD 01E(1) ;GET KTBD 
ANI OF ; MASK 4 MSB 
JZ COUNT - 


Conclusions: This program is not well structured because 
the green (broken) line from line 51 to line 123 must cross 
one red (solid) line while inbound (near line 123). 

The program would be well structured if the block from 
line 107 to line 119 were to be placed after line 133; however 
one would have to add the instruction “JMP DISPLY” after 
line 103 to replace the normal “FALL THROUGH” from line 
103 to line 107. After moving the block the instruction at line 
133 will not be needed because it will become a “fall through” 
and the red line will go away. 

Honesty compels the observation that the program will 
work the same after moving the block of code as discussed— 
but—it will look better from a “well structured” standpoint. 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 9 


19 














ISIS: Anatomy of a Real-World 

Operating System 


by Perry C. Hutchison 
Computer Science Department 
Iowa State University 
Ames, IA 50010 


Dear Jim: Received: 77 Dec 23 

I am enclosing a sort of “internal logic manual” for Intel’s 
ISIS system. This all started some months ago when I became 
the victim of a persistent “data CRC” error on the MDS which 
could not be reproduced on anything else. Several phone calls 
to Intel produced only the claim that, by the time the error 
message came out, the information as to what track and sector 
were involved was no longer available anywhere in the 
machine. This sounded rather preposterous, so I went 
a-hunting. About 2 weeks’ work, spread over a considerably 
longer period, yielded the discoveries contained in this write¬ 
up. Since I don’t suppose I am all that unique in needing to 
debug things in the context of ISIS, I decided to write it up 
for publication. It will probably be fairly interesting to 8080 
(and Z-80) hackers, even if they don’t have access to an MDS. 
The ISIS disk allocation and directory policies would make 
an excellent standard for floppy disk file systems. 

This article may also be useful as context for Max 
Agoston’s RIMOS (DDJ 9/77). 

Very truly yours, 

Perry C. Hutchison 


ISIS (Intel Systems Implementation Supervisor) is the 
floppy disk operating system developed by Intel Corporation 
for the Intellec MDS microcomputer system. ISIS was written 
entirely in PL/M, a dialect of PL/1 oriented to the 8080 micro¬ 
processor. The ISIS system is exceptionally well designed; it 
bears significant resemblance to Bell Labs’ UNIX operating 
system for the PDP-11. 

Intel has released neither the source code nor any internal 
documentation concerning ISIS. Since a knowledge of the 
internal workings of such systems is occasionally needed if 
they are to be utilized to the full extent of their capabilities, 
a study of the object code was undertaken. This document 
contains the principal findings of that study. It should be 
useful both as a reference for use by persons having occasion 
to deal with the internals of the ISIS system and as an educa¬ 
tional example of what really goes on in a small single-user 
operating system. Names used are taken from the published 
ISIS documentation where appropriate. 

The information contained herein has been derived from an 
examination of the object code of Version 1.2 of 32K ISIS, 
received in August, 1976. (The same disk also contains Version 
1.1 of ASM80, 1.3 of EDIT, 1.1 of UPM, and 2.0 ofICE80.) 
Except where a more general applicability is specifically 
stated, this information should not be expected to apply to 
any other version of ISIS. 

It is probable that, despite thorough checking, some errors 
will be found in this presentation. The author would 
appreciate being informed of them. 

Page 10 


Environment 

ISIS operates in the Intellec MDS microcomputer system, 
and uses the facilities of the MDS Monitor ROM (which 
occupies addresses F800H - FFFFH) to communicate with 
character-oriented peripheral devices (i.e. everything but the 
disk). Table I lists the entry points and functions of the 
principal Monitor routines. Parameters and returned values are 
handled as in PL/M — see the discussion below. (There are, 
of course, additional subroutines in the ROM, but an assembly 
listing of the ROM is included with the MDS and anyone 
interested in its internal workings can look it up. ISIS uses 
no Monitor entry points other than those listed in Table I.) 

A detailed description of the MDS disk controller is 
contained in the Intel MDS-DOS Hardware Reference Manual 
and will be only briefly summarized here. The controller 
occupies I/O ports 78H - 7FH, and is controlled principally 
by a program-generated “I/O Parameter Block” (IOPB) in 
memory. The address of the IOPB is supplied to the controller 
by outputting its low and high bytes to output ports 79H and 
7AH. The IOPB identifies the drive, the operation to be 
performed, the sector count, the track address, the starting 
sector address, and the starting memory address for reading 
or writing. The disk controller contains a DMA controller 
which is used for reading the IOPB as well as for transferring 
data. 

Organization 

ISIS consists of some 57 PL/M procedures, including 8 
which merely provide access to the Monitor ROM. The 
remaining 49, plus two compiler-generated subroutines, are 
listed in Table II; Figures 1 and 2 depict the caller-called 
relationships. (Many of the routines of Fig. 1 call one or 
more routines of Fig. 2, but the spaghetti effect would render 
a combined drawing incomprehensible.) The heavy lines in 
Fig. 1 lead to routines which directly correspond to and 
implement the various ISIS system calls. (The procedures 
ERROR and XEQIOPB are actually Fig. 2 routines, but the 
direct calls to them from ISIS are shown in Fig. 1 for com¬ 
pleteness.) 

Table II should be largely self-explanatory, with the 
exception of a few abbreviations and notational conventions. 
The second column contains the Entry Point address of the 
procedure. The columns labeled “T” signify the Type of the 
associated quantity: A (Address) denotes a 16-bit value, B 
(Byte) an 8-bit value, and L (Logical) a Byte value used in 
a True-False sense. (An odd value is taken as True, an even 
value as False.) The column labeled “ADDR” is used for 
two related purposes: in the case of procedures which have 
parameters, it gives the memory address at which each 
parameter is stored; in the case of non-parametric procedures 
it gives the address at which the first of that procedure’s 
local variables is stored. (Local variables of parametric pro¬ 
cedures are stored immediately following the last parameter.) 
A dash in this column signifies that the procedure has no local 
variables and, except in the case of the compiler-generated 
subroutines, no parameters. 

Number 21 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


20 



The combining of ATTRIB and RENAME is a clutter-reducing notational convenience having no special 
significance. Both call the same three subroutines. 



Number 21 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 






When one procedure is entirely contained within another, 
the table entry for the inner procedure immediately follows 
that for the outer one and the inner name is indented two 
spaces. 

Data Structures 

One of the principal motivations for this study has been the 
desire to obtain information of diagnostic usefulness. To that 
end. Table III presents a list of memory addresses whose con¬ 
tents may assist in diagnosing troubles. In addition, parameter 
values in active procedures may be useful. A traceback of 
procedure calls is fairly easily obtained from the stack, since 
entries other than return addresses are rare. The locations of 
the parameters may then be found from Table II. 

The central in-memory data structure of ISIS is the File 
Structure, located in memory addresses 29E5 through 2B1B 
inclusive and summarized in Table IV. The File Structure 
consists of 18 tables, each containing 10 entries; each table 
has associated with it a “current pointer” which contains the 
address of the entry in that table which pertains to the current 
file (whose table index may, in turn, be found in 29E5). The 
first two entries (numbered 0 and 1) in each table always refer 
to the directories of disks 0 and 1; in a sense the directories are 
always open, although they do not always have buffers allo¬ 
cated. Entries 2 and 3 are the console files :CO: and :CI:. This 
leaves entries 4 through 9 for the six files which a user 
program may have open at any one time. Each open file 
corresponds to one entry in each table, but most of these 
entries are unused if the file is not on a disk. 

The parameter AFT which many of the ISIS procedures 
require is simply a number in the range of 0 to 9 identifying 
a set of entries in the tables of the File Structure. This differs 
from the AFTN supplied by the user (and returned by OPEN) 
in that AFT = AFTN + 2. 

The I.V. (Initial Value) shown in Table IV is the value 
which appears in the particular File Structure member for a 
disk file which has just been opened. 


Disk Layout 


known. Thus the first Linkage block of the directory itself is 
always assumed to be Track 1 Block 1, and the Data blocks of 
the Allocation Bit Map are assumed to be Track 2 Blocks 2 
and 3. The boot ROM expects to find the System Initialization 
Program starting at Track 0 Block 1 and occupying as much of 
Track 0 as may be needed; the System Initialization Program 
then assumes that the first Linkage block of the file ISIS.BIN 
(which contains the system proper) will be found at Track 2 
Block 4. 

Secret “XEQIOPB” System Call 

The XEQIOPB system call is not described in the published 
ISIS documentation. Its “command” value is 68 decimal 
(44 hex); the “parameter block” must contain the following 
3 words: 534BH, drive, .iopb (where drive is 0 or 1 and .iopb 
is the memory address of the IOPB to be executed). This is 
presumably intended to be used by programs like FORMAT 
which need to perform disk operations not needed by 
“normal” programs. The IOPB is to be set up as if it were to 
run on drive 0, regardless of which drive is specified; XEQIOPB 
takes care of inserting the drive identification in the proper 
places. Normal system handling of disk errors is provided. 
Note that this call bypasses all directory accessing, file map¬ 
ping, and protection flags, and must therefore be used only 
with extreme caution. One possible use would be in a program 
which does a sector-for-sector copy of a disk. This would be 
much faster than FORMAT $A since the normal disk alloca¬ 
tion mechanism involves considerable overhead. Such a 
program could even copy a non-ISIS disk, e.g., DEC RT11, 
CP/M, etc., if needed. 

Similar calls exist in Version 1.6 of 16K ISIS (the 534BH 
entry in the parameter block is not examined, but the drive 
and the IOPB address are still taken from the second and third 
words) and in Version 2.2 of ISIS-II (the parameter block 
contains only the drive and the IOPB adress — the 534BH is 
omitted); however since this is an unpublished feature, any 
program using it must be considered system-dependent. The 
possibility exists that such programs will not work with some 
future version of ISIS. 


The principles of the ISIS disk organization were rather 
well described by David Yulke in the December 1977 issue 
of Kilobaud (although he didn’t mention ISIS by name), 
but will be included here for completeness and to provide 
additional details. 

In ISIS, every disk sector falls into one of three groups: 
Data blocks, Linkage blocks, and Free blocks; this statement 
applies to system data as well as to user files. An ISIS file 
sonsists of Linkage blocks and Data blocks. Data blocks 
contain the bytes which compose the file, while Linkage 
blocks (Yulke calls them Map blocks) tell how the Data 
blocks are to be linked together. The first two bytes of a 
Linkage block contain the disk address of this file’s preceding 
Linkage block (zero if this is the first). All disk addresses 
in ISIS are stored as a Block Number and a Track Number. 
Tracks are numbered from 0 to 76 and the blocks of each 
track are numbered from 1 to 26. The next two bytes contain 
the disk address of the following Linkage block. The remaining 
124 bytes contain the disk addresses of up to 62 data blocks. 

Every ISIS-format disk contains four system files, 
collectively referred to as the Format files. These may be 
opened for input and read just like any other file, but may 
never be written into (except by special system routines). 
Tables VI and VII list the Format files and describe their 
contents. 

The system does not always bother to look the Format 
files up in the directory; it assumes that their locations are 

Page 12 


User-Program Use of ISIS Procedures 

A user program may occasionally need to perform a proces¬ 
sing task similar or identical to that performed by one of the 
ISIS procedures. In such a case, it may be desirable to call the 
system routine rather than having to write and debug code to 
perform the same function. In order to do this, a few details of 
the implementation of PL/M must be understood. 

Up to two parameters of a procedure are passed in via 
registers. (The first thing a parametric procedure does is to 
store the appropriate registers into the memory locations 
reserved for those parameters.) A procedure having one para¬ 
meter will expect the parameter to be in the C register (if a 
Byte) or in the BC register pair (if an Address). If there are 
two or more parameters, the last will be in the E (or DE) and 
the next-to-last will be in the C (or BC). The CALLER must 
store all other parameters into the proper memory locations 
before the procedure is entered. (This sounds messy, and it is. 
Newer PL/M compilers pass extra parameters on the stack, 
which is much nicer.) 

A procedure which returns a Byte value will return it in the 
A register; one which returns an Address will return the more- 
significant byte in the B register and the less-significant byte 
in the A. (Note: this does not apply to the compiler-generated 
MPY and DIVIDE routines — see Table II.) Except for such 
returned values, the contents of the registers upon return from 
a procedure cannot in general be depended upon. 

Number 21 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


22 


The benefits of using a system routine must of course be 
weighed against the extreme system dependency which results: 
the routines will almost certainly be in different places in 
different versions of the system and there is no guarantee 
that, even after they have been found in a new version, their 
results will be the same as before. 

Conclusion 

Users of the ISIS operating system have heretofore been 
hampered by the lack of documentation on its internal opera¬ 
tion. While such documentation is not necessary most of the 
time, the need for it occasionally becomes critical. This presen¬ 
tation should partially fill that need for Intel customers while 
also assisting hobbyists in understanding how a first-rate 
operating system and file handler is organized. 



CP/M USERS’ GROUP 

Dear Jim: Received: 77 Dec 16 

Just a note to inform you that there exists a CP/M Users’ 
Group which is active both in user software exchange and also 
in group purchasing of proprietary software. Although desig¬ 
nated CP/M Users’ Group, we also naturally welcome users of 
IMSAI DOS-A and M-DOS and of the Cromemco CDOS, and 
soon expect to see a TDL FDOS which is similarly compatible 
with CP/M in terms of program load point, DOS call conven¬ 
tion and diskette allocation and directory format. 

Kindest regards, 345 E 86 Street 

Anthony R. Gold New York, Ny 10028 


NORTH STAR EXECUTIVE SOFTWARE 

News Release Received: 77 Sept 13 

XEK, a complete system executive package for North Star 
users, is now available from the Byte Shop of Westminster. 

The XEK package contains a disassembler capable of 
creating files that may be left in memory when changing from 
the disassembler to the executive package for re-assembly. 
The monitor software has the ability to accept input from 
cassette tapes and paper tape as either source or object files, 
as well as from the North Star diskette system. In addition, 
the assembler features a new auto-line editor for the creation 
of source files. This editor also extends to the modification of 
existing object files. 

Another feature is the XEK’s ability to handle up to six 
named files at once that may be consecutively assembled to 
form one object file. The assembler, monitor, and disassembler 
come with complete documentation, both on disk and as a 
manual. Total price, including first class postage, insurance 
and California resident’s sales tax, is $48.00. For further 
information and ordering, contact: The Byte Shop of West¬ 
minster, 14300 Beach Boulevard, Westminster, CA 92683, 
(714) 894-9131. 


rt <-> 
M 3 
«5 a 
x g 


t/i Q> 
C -h 
^ O 

3 52 

♦J G 
Q> O 

co. u 


V) 

*-> +J 
3 3 
CX CX 
*-> *-» 

3 3 


2 u 
8- *-» 
O 

«/> 

G ^ 
cl 
3 X 

*-> o 
a> 

CC nJ 


f-i o 
U 4-» 

3 X 
U X 

Vi -h 
G O 

u u 
3 ♦-» 
*-* G 

a> o 
a; u 


w to 
g a 
o s 


oort 
a d,s: 


17) • 

4-* O 
3 O 

CX-H 
«-» > 
g .s 


tc M 

•H T3 

X T3 
rt 

«/> 

£ f? 

3 O 


> 
17) O 
c T3 


a" 


> 4J nJ 


to 

H 

< 

H 

tO 


UJ 

H 

>- 


H 

3 

O 


Q >- 

t—t CC 

§£ 

O. UJ 


UJ 

p 


H 

3 

O 


H 

CO 

U 


a 

i 


Number 21 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 13 


23 


future 



Table II. Internal ISIS Procedures name- e.p. parameter t addr returns t purpose. calls 


C O O H 

= O' < f. 

uc wa 
w uj c: > 


h 

< u. ^ u 

u d u t- u u 

OCQQ W< UW 
JCUh Nh 

j j w q > m a: 

<uu kq: w 2 


U 3 CX CX rt 


O O O CJ O O 

3 U 3 E 5 E 


OS -J 

UJ < 

it fee 

HDDU 
U. CQ O < 
< • U • 


tu O r« -t o 
o a a q a 
u u u u u 

<N (N rvi rvi rj 


UJ <3 

£££§ 
HD D U< 
U. ffl o <U 
< • u • 2 



3 Q CO UJ U 

co ^ c. < u u u 

uj o*~<<u:Hu:l; 1 -co 

Ul>-<2^UHN2Hh 

c£Ouu:uj^uiuj>-<>-cs;ci 


u c: z 

CO O U. 2 ; 

O KH w 
-J es u; a. 
U UJ u o 


< o u. 

X 2 OS H 

a. 2 cs uj 

5 : cs uj o 


= CO 
U D cc 
aiiHu< 
ou. 

c: H c<H 
u u u uj u 
UJ o to to to 


—• O 

C C 3 O 

O 3 *J O 

•h to a 

U* 3 3 to 
3 U to 

U *“ H O 

U E a> H 

X O *J ~3 

a> 4-» c -o 

to -H « 
to X 

o <o td u 


UD P u 

o v c a 
H ^ a> > 


2 c uj uj 

fl> to cx 

& to < UJ 

n h 2r 
C cx -3 
•H O O 4-» 
D U U rl 
to 

to -h a> qc 
H 3 C 

^ U 0* H 

O to o *-> 
> < u u 


c» cr* di 
or 31 or 

fN CM (M CM 


31 < UJ 

U) UJ 31 

u u a 

cm cm cm 


OS H 

UJ uj »-• 

CQ UJ OS O 
A to UJ H 

3 < = a 
2 cas Z 


CQ 

CO 

J 

O' 

2 

< 

J 

o 

UJ 

u 

u 

Q 


Page 14 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 21 


24 




NAME- E.P. PARAMETER T ADDR RETURNS T PURPOSE. CALLS— NAME- E.P. PARAMETER T ADDR RETURNS T PURPOSE.. CALLS— 


> ea 
cc: uj < 

C Q H 

cc o H H 

h c: h huj uj 

cj uj u. cc co c/) 


— CQ 

e:zu< uj 

O U. cC H U H 

cc H < H g ^ 
CC UJ UJ UJ >- CC 

W U W w w 2 


u CO CQ 

O CQ O. 

-3 C. < UJ O 

J < u: t- H *-• 

<2. lu E— h o' 

uj 3c UJ UJ CC UJ 

o CC w W > X 


CQ O 2 < 

uj cc c wu: u 
UJHX<ZUJH 
cj uj a. uj uj uj uj 
u. (dt. cc c:w w 


CJ 

H *H 

a u. 

(/) u. «. 
o =) c 
£ta o 

5 -H 
C +-» • 

Sh -H .H ft) 
f O 1/1 t-H 

Jut VI o JQ 
^■h am 

J3 W U-H 

v> a) rt 

V» O s > 

0) U O eft 

H 


w ,* ft) • 

■o u au 

rt O O —i 

ft) H M -r4 

cc x> a 4-. 


e -h ^ <d 
o 4-* o x: 
u c o 

4J 3 T3 rt 
0) ft) 
Ifl C -H ^ 
U UJ 4-. 

ft) U. tf) V) 
*-> U_ -H -H 

U D 

Cl CQ eft 0 ) 

f>l t/l f-H 
CJ O -H 
x: u) v) 4 -t 
O C -H I 
•H 4 -t 
V) Ho 
U D 2 I 
« -< 2 T3 
ft) o C 
esc 4 h cj a> 


-a c 

ft) -H 

o i e 
u* ft) C • 
X C -H ft) 

X) -H w c 

I H ft) -H 


C 4t£ C 
O *■» ft) 
ft) U 

JZ u o u 

J ft) J 3 


V) u» o 

O CTJ U> 

U) o O • 
ft) O 1) < 
•-* —< f-< -S’ 
ft) »-h -H Q 
O eft -3 <N 


Q UJ O CM 
Q Q UJ UJ 

cj u u u 

CM CM CM fN 


UJ < 

u- H ^ 

. U- Z H 
h3 D U 
U. CQ O < 
< • u • 


CQ 

Z CL 
O UJ O Z 


h UJO f- , K, <2 OUJOZ UJ CJ X CC 

CnnWWhOHQSJQ<U^UhHUJ COOUZUJQ 

uczjHCH<uj<z^ujOHcya. ocj*uju< 
(-JOWQCxOauJUJujujrciujo j c: w cl < u 
CUUOujuJujJoaJaJo'inSSxc^ uwz o o-e: 


<u- Hu. a u = ca cj 

UD CiHtOU.D22CLhU< ui UJ 

O CC O UJ UJ <CQlLM<<c:UUh w 

J CJ cJ uj uj HhH3:^c:<hi: Hh 
—J j DC CC CC UJ UJ UJ UJ 2: CJ UJ U)>- cc cc 

<CJ UU.U. UOU cCcCW W WW X *2 


■o 3 /-N C ‘ 
ft) O UJ ft) T3 

u* U C. > C 

rt w -h eft • 

u C be 

ft) O « V) 

C -H ft) C 

ft) u» *-h be ’ 

be Cft CJ -H *H 

i u cq U-t in ■ 

U *H N-' V) 

ft) eft eft 

-« H N 

•H -H V) •• 

CLu» ^ C ft) 

E UJ ft) E 

0 3 0 a, eft 

V B (DC 


H l/l UJ 
f-i w 
V) ft) rH 

ft) 4 h UJ 
ft) 4 -t UJ 
U 3 CC 
U. 3 U. 


00 < CJ UJ 
Ul UJ UJ UJ 
Q Q Q Q 

CM CM fN tN 


Z H 

UJ 2 CC 

U. Uj UJ 


Number 21 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 15 


25 





name- e.p. parameter t addr returns t purpose. calls— Table III. ISIS Variables of Diagnostic Significance 


"2 i e 


rt rt 

o g 

$ 8. 
E 

3 4) 

O *-» 

UJ 

3 G 

G O 

a a 


to 

to 

£ 

a 


a 

a 

rsi 

i 

U 

s 


5 '3 

H 

G.2 


rt 

r-H 4) 
rt *-* 
u uj 
•H C 
tC. -H 


u c 
♦-* o 

•H 5! 


X) 4> 
4) X 

Q 4-» 


Cl *H iH 

x n 

ec H 4-» 


G UJ 
0 0—4 

-« X O 


3 O a 
h h y 
rt O O 
> M 


*J E 4> rt 


>9 9 


u ifl Ifl 
X 4> 

= UJ uj 
UJ 3 
Jui rt 
a o 
o 

— to *j 
u oi 

= U 5 


x ^ 

T3 'o' • O 
O H H W 
*-» .Q rt rt 
rt rt 3 uj 
G G G UJ 
O Cl i« (I 

c > s: e 
O o 

oc u o r 
41 k t 

r g rt cm 

4) I 2 
GC 3 G 
X O G O 
H C rt o£ 

’ — cc 

♦J UJ 

h: w: 
3-3 0 
UJ G Q 4) 

u eg i x 

cc x to *j 
r : a 

Z 4h 
”3 rt ' O 

G O 
3 X X *-» 
4-» G G 


cc o rt 

•H • 

4-» G U) 3 
—• O 4> 
3 4) -H *j 
w C il C 
41 C U -H 

— O 4) G 

- 0 3 3* 


G X 

o o 

4* rt 


3 O 4-< 

4) 3 . 

*-• G X 

a* g 
e 2 « 

4) C. 


G. C 


! 4> E 


> rt c 
« G. O G 
. tO O h 


G G O »-t 
4> 4) 

4-t tM 
4-4 IM 

55 


4> 00 —< 


£2 


g o, 
X X 
CO H 


o 3 
CO CQ 
CO CS| 


“ o 

y s 

< rt 


G U 
X-h 

X u. 

X 0 O 
G O a 
X 3 CM 
M C I 
3 h a 


I 4) 
X 


s. a - * 

X) G O 

• O X 

CM Cm G 


uj 


u o 

H l/| !0 w 
<4 C S3 X 
G -H (N 4) 
G rt l 
fl> U N 4> 
*J G o° E 

coon 

•-t t» cm G 


O 

S 

H 


G 5 

5 £ 


* c. 
zr uj 
O 4) 
CG G 
< 

UJ X 
to G 


(?3 

cb' 


3 & 3 


CX5 G 
o uj 
X nJ 


&,a 
rt o 


UDK7. UZt<UUJ 

OCQOUlUH<UUJy) 

jkc:u.w JZhNH 


88 


as 


CG 

1 

C£ 

UJ 


0 0 4) 
G. G —-« 

OX;-* 

CC X *G 


3 W h 

a: -h 

H 3 4-1 
4) 

UJ G 4> 
C to oc 
G O G 
3 3 rt 


CC X 
C r-. 
t-4 G 
z o 
g. 
in o 

- G 


UJ 

a g • 

3 4> uj 
G 4) 
UJ C H 
4-» -h a 

o o « 

to G. G 


rt h 

5.5 


•H .* 

^ o 

5 O 


«j O 
4-» 
CC UJ 
UJ 4> 


ZD o 

a u 


O 4) r 


•h 4i m 
G.E C 

o rt o 

U G U 


4) 

4J • 

u e: 
rt uj 

G U. 

rt u. 

x a 

U CO 

H E 
2 O 

a g 

o 4-1 


O 

G. 

O 4-. 


*-* E > 

-H o *H 

G G G 


> O. UJ 3 

•H O 4) c 

G 3 rt 


G. 3 O 

G- h G,< 

3 O rt O' 

m G > c 

I 4-J c < 

GN h o rt 1 


X G UJ 4-» 

o o m 

4) 4-* O 3 •-4 
3 G 3 C -4 

•—« -h o rt 
rt uj G. o 
> C -H UJ 


se 


o * 
G O 
G -H 
O 

u 44 


a uj o cm 
CM <N to PO 

a a a a 

CM CM CM CM 


rf o oo a 

3 3 3 3 

a a a a 

CM CM fN CM 


UJUJ 

aa 

CM CM 


CM CM 
CQ CQ 
CM CM 


3 tO vO 00 
tO tO to tO 
CQ CO CQ CQ 
CM CM cm (NJ 


UJ O h 
H a a x 

U* Q CQ CQ 

<5 • • 


Si 


D^ZZ 

a a x x 
a a cq a 


Ha 
Uj a 


H a 
u. a 

< • 


UJ CQ 


CC 

a u uj 
Q a uj uu 

o > lo a 
■jn x a 
d. c: ^ a 
o a {— . 


a 

H 

a 


a 

< 


H 

s 


cy 

a 

x 


o 

t-4 

X 


Page 16 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 21 


26 





addresses contents.-.-.—.-. Table V. ISIS Device Identification Codes 



hmqhohh q:q: hm a a. . 


CQ OHNNl-tlOvOMOOlOHOJ (O Tt 1/1 <5 N 


UJ 


b *-* 

Z tO 


C/5 

UJ 

C/5 I 
C/5 • 
UJ I 
ci < 
a H 
9< 


O 


I H f-l 


X5 


S; 

z 


g 3 

C/5 C/5 


s § 


a 

w 

b 

o 


Q 

00 

00 


U. _ M HH 


-O 

CC3 

H 


o 

to 

3 U 

U« *J 

o a> 

> ~t 

a> a> 
c "3 




C X ^ 
*-• V5 X I 


E 

3 

2 


efl 

K 

H 


8 8 


to oc 
to ca 
a> jc 
m c 


x, 

UJ 

w O 


la 


be to 

o c 

r-t U* 

3 


b 

o 

E 

O 

s 

£ 

2 

x 

o 

3 

u» 

■*—> 

C/3 


cz 


2 

H 


X 

cu 

o 


UJ 

^ o> 

(J M 
O 

—t *-» 
J3 rt 

I 

.* ♦-» 


to C 
o o 
U U 


D 10 

3 H 

E— *-» 


rt 

4-> 

c3 

•3 


O -H 

2 o 

H E 


O 

• 

0) o 

J3 —< 

sa 


C/5 

t • 

J«C Jrf 

o o 

c3 O 

u ^ 

t— J3 


2 5 


*-»*-» O 


*3 Q 9 

2g3 


c 

o 

CJ 

O) 

33 

U- 

C /3 


eccc 

8fc 


s a s 


« 

a 


a a a a a 


3 

a 


< 

o 

a 


8 

a 


X5 

cd 

H 


3 2 


CJ 

a 


i 


Q£ 

E 


UJ 

I 


Number 21 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 17 


27 










The SAM 76 


by Ancelme Roichel 
copyright 1977 

Pennington New Jersey, U.S.A. 
All Rights Reserved 


Language 


(T 

U 

U 

U 

U 

U 

{} 

1) 

U 

0 

U 


n 

n 

This text was formatted from a raw text file {} 

employing procedures which make use of the {) 

U 

<ncra> 21 {) 

0 

SAM76 language processor {} 

{) 

{} 

_II 


Typographical and code assignment table 




0 

1 

2 

3 

4 

5 

6 

7 

8 

9 

A 

B 

C 

D 

E 

F 



0 

0 

0 

0 

1 

1 

1 

1 

2 

2 

2 

2 

3 

3 

3 

3 



0 

2 

4 

6 

0 

2 

4 

6 

0 

2 

4 

6 

0 

2 

4 

6 

0 

00 




0 

@ 

P 

• 

P 




0 

@ 

P 

' 

P 

1 

01 



i 

1 

A 

Q 

a 

q 



; 

1 

A 

0 

a 

a 

2 

02 



11 

2 

B 

R 

b 

r 



" 

2 

B 

R 

b 

r 

3 

03 



It 

3 

C 

S 

c 

s 



It 

3 

C 

S 

c 

s 

4 

04 



$ 

4 

D 

T 

d 

t 



$ 

4 

D 

T 

d 

t 

5 

05 



% 

5 

E 

U 

e 

u 



% 

5 

E 

U 

e 

u 

6 

06 



& 

6 

F 

V 

f 

v 



& 

6 

F 

V 

f 

V 

7 

07 



1 

7 

G 

w 

g 

w 



1 

7 

G 

w 

g 

w 

8 

10 



( 

8 

H 

X 

h 

X 



( 

8 

H 

X 

h 

X 

9 

11 



) 

9 

I 

Y 

i 

y 



) 

9 

I 

Y 

i 

y 

A 

12 



* 

: 

J 

Z 

j 

z 



* 

: 

J 

Z 

j 

z 

B 

13 



+ 

t 

K 

( 

k 

{ 



+ 

f 

K 

[ 

k 

{ 

C 

14 



t 

< 

L 

\ 

1 

1 



f 

< 

L 

\ 

1 

1 

D 

15 



- 

= 

M 

} 

m 

} 



- 

= 

M 

] 

m 

} 

E 

16 



. 

> 

N 

“ 

n 

~ 



. 

> 

N 

“ 

n 

~ 

F 

17 



/ 

7> 

0 


o 




/ 

? 

0 


o 



The SAM 76 Language 


The SAM76 language combines into a single interpretive 
processor characteristics of two different string and 
general purpose macro generators and one (or more) infix 
operator mathematical systems. 

SAM76 was primarily inspired by the "M6 MACRO PROCESSOR" 
designed by M. D. Me Ilroy and R. Morris of the Bell 
Telephone Laboratories. A description authored by Andrew D. 
Hall is given in the Bell Lab. Computing Science Technical 
Report #2, and other places. 


The second source of inspiration came from the syntax of 
"GPM - a GENERAL PURPOSE MACRO GENERATOR" described by its 
author - C. Strachey. 

GPM syntax very significantly improves the interface 
between the user and the language by eliminating an 
awkwardness inherent in the design of M6. This awkwardness 
arises out of the fact that in the M6 language the 
specification for the action to be performed on the result 
of an expression evaluation is at the right hand end of the 
expression to be evaluated; this requirement causes the 
need for a unique pair of characters to be designated for 
the purposes of "quotation"; consequently when the writer 
of procedures in M6 is terminating the writing of an 
expression he must mentally reconstruct the sequence of 
alternations of "quoted", "active" and "neutral" 
expressions which may be nested one within the other. 

In GPM, where the nature of the expression is specified at 
the left end, only one character need be identified to 
serve to provide the right hand boundary for all three 
types. 

Ibis means that the user, when closing out his writings, 
need only supply enough such identical characters (plus a 
few for good measure) to enable correct action to 
subsequently take place. 

An universal lament of users of both M6 and GPM relates to 
the extremely unnatural method in which arithmetic 
expressions must be organized. The simplest arithmetic 
expression in normal "infix" notation becomes a tortuous 
involved nest of strange symbols when expressed in either 
M6 or GPM. A simple solution exists, is incorporated in 
SAM76 and forms the third element of the language. 

In addition inspiration for the selection and design of a 
number of the resident functions came from a variety of 
sources (see reference list). 

Acknowledgement is made of the contribution made by L. 
Peter Deutsch [U.C. Berkeley] who conceived of nesting an 
expression calling for input inside an expression which 
causes output [Ref. 3] thus: 

{OUTPUT,{INPUT}} 

Finally acknowlegement and great appreciation is expressed 
for: 

The help received from Neil Colvin [M.I.T.] who provided me 
with an 8080 simulator for the PDP-10 and who coded a 
preliminary version of the language to run in an 8080 based 
microprocessor system contributed also materially to the 
development of this language. 


Page 18 


Dr. Dobb's Journal of Computer Calisthenics 8< Orthodontia, Box E, Menlo Park, CA 94025 


Number 21 


28 



Barry Lubowsky [Rider College] who allowed me to make use 
of a PDP-10 and who was most helpful with some system 
software problems. 

Roger Amidon [Delta Data Systems], whose actual 8080 based 
"ALTAIR" and "IMSAI" microcomputers were used to test and 
debug the software, was also most helpful in developing a 
family of "people" oriented mnemonics and functions 
particularly well suited for the "amateur" user. 

Other people who contributed to various details and who 
"people" tested the language are Carl Galletti [T.D.L.], 
Marty Nichols [Newsweek], and Tom Kirk [N.J. Bell]. 

References 

1. Strachey, C. - "A general purpose macrogenerator". 


Computer Journal, Vol. 
1196510001. 

8, No. 

3, Oct. 1965 p. 

225; 

2. Hall, Andrew D. 

- "The 

M6 macroprocessor", 

Bell 


Telephone Labs; Computer Science Report No. 2; 1971; 

3. Kagan, Claude A. R. - "A string language Processor for 
small machines", Proceedings of the ACM SIGPLAN Symposium 
on the Pedagogical Applications of small Computers, 
University of Kansas, Lawrence, Kansas 1197111181. 


II II This description of the SAM76 language 

I I Notice 11 is substantially the same that is 

IJ_JJ available from the IEEE Computer Society 

Repository, R 76-301 - August 1976. 


The three elements of SAM76 


The first element is designed around the 11 
characteristics described by STRACHEY in 11 GPM - S76 11 

his GPM (General Purpose Macro Generator) IJ_[I 

language. 

Strachey defined its general forms as follows: 

Active %function,arguments, . : 

Neutral %VAL,function,arguments, . . . : 

In order to avoid ambiguity and to provide consistency the 
above is changed for the purposes of SAM76 as follows: 


Active %function,arguments, . / 

Neutral ^function,arguments, . / 


Protected ! . . . protected string . . . / 

In addition changes and extensions are made to the language 
originally described by Strachey. The modified form 
incorporated in SAM76 is to be known as S76; this is a 
fully operational proper subset of SAM76. 

The syntax used in connection with the S76 system is to be 
referred to as the "S" syntax of SAM 76. 


The second element is substantially as 11 

described by Andy HALL for the M6 II M6 - M76 I I 

language attributed to Me ILRDY and IJ_[I 

MORRIS: 


Active ((function, arguments,.: 

Neutral #function,arguments, . ; 

Except for different function mnemonics no change was made 
in the syntax and notation of M6 for the purposes of SAM76. 

Number 21 Dr. Dobb's Journal of Computer Calisthenics 


In consequence routines and texts written for M6 processors 
distributed by the Bell Labs outside the Bell System should 
be compatible with SAM76. 

Compatibility with M6 is insured by enabling user to 
stipulate whether "resident" or "user defined" functions 
are to be first searched whenever an expression is to be 
evaluated. 

Expressions written using the M76 syntax will first cause a 
search of the user defined functions; if no user defined 
function of that name exists then a search is made of the 
resident functions. Expressions written using the S76 
syntax will first search the resident functions. 

Although there is syntactic compatibility with M6, the 
implementation in SAM76 is designated M76 because of the 
generally different complement of resident functions, and 
the significant enhancement of the scan algorithm. 

Hie syntactic form of expressions based on the M76 system 
is to be referred to as the "M" syntax. 


An infix operator system characterized in I I II 
general by the following example for a 11 A76 11 
simple arithmetic expression: IJ_j| 


Example [ 5 + 5 * (144/12) ] 

Hie syntax of the foregoing system is to be referred to as 
the "A" syntax. Hie evaluation rules and internal syntax 
may vary between systems for this sub system; a method of 
identification is provided within the framework of SAM76. 


Input - Activating - Scanning and Output 


I I The flow of characters, be they 

I I Input and 11 procedures (programs) or just plain text 

I I Output 11 between the SAM76 processor and either 

IJ_[I the user or other sources or destinations 

is under the control of two resident 

SAM76 functions: 

Input from user (or source) to SAM76 is under control of 
the "input string" function whose mnemonics are "IS"; this 
may be used in either the "S" or "M" syntax either as an 
active or neutral function thus: 


type 

active 

neutral 

S76 

%IS/ or 

&IS/ 

M76 

#IS: or 

IIS; 


Output from the SAM76 processor to the user (or other 
destination) is controlled by the resident "output string" 
function, mnemonic of which is "OS"; active or neutral use 


in both the "S" 

1 and "M" 

syntax 

is: 



type 

active 


neutral 



S76 

%OS/ 

or 

SOS/ 



M76 

#05: 

or 

IOS; 



Initially and 

whenever 

its task has been 

II 


completed, 

the 

5AM76 

processor 

1 1 

Hie 

automatically 

loads 

a 

"restart" 

II 

"restart" 

expression which is scanned and 

provides 

II 

expression 


the means for accepting input and 
delivering output; this expression is 
initially defined as the S76 expression: 


&os,%is//= 

Orthodontia, Box E, Menlo Park, CA 94025 Page 19 

29 











The initial or standardized condition 
makes use of the equal sign "=" to 
ACTIVATE the processor; this "activating" 
character may be changed by the user 
through execution of the appropriate 
SAM76 resident function. 


I Activating 
I the 
I processor 
I_ 


II II When expressions are nested one within 

II Scanning II the other, the SAM76 processor first 

IJ_[I executes the innermost, proceeding from 

left to right. 

Hie innermost in the "restart" expression is: 

%is/ 

and therefore input is sought; the user input is terminated 
with an activating character, the (=) will be shown to 
remind the user how to terminate his input. 

Once the input is terminated, it is in turn examined by the 
scanner for possible further execution until finally the 
outermost expression of the "restart" expression is 
encountered: 

&os, ... / 

where the series of periods represents the result of 
processing the user input and in fact will be the output 
that is to be given the user. 


i| Quoting or Protection 


Frequently the user may wish to incorporate in his text 
certain characters which have special meaning to the 
scanning system of SAM76. Typical of these are the 
characters used to indicate the start and end of 
expressions. These are known as "warning characters". 

For standardization purposes a processor for the SAM76 
language is initialized with the following assignment of 
"warning characters": 


Abbv. 

Char. 

Octal 

Purpose 

SA 

% 

45 

Begin S76 active expression 

SN 

& 

43 

Begin S76 neutral expression 

SP 

1 

41 

Begin S76 protected string 

SE 

/ 

52 

End S76 expr. or protected string 

MB 

# 

43 

Begin M76 expression 

MA 

: 

72 

End M76 active expression 

MN 

1 

73 

End M76 neutral expression 

AS 

r 

77 

Argument separator 

QC 

@ 

100 

Quote single character 

BQ 

< 

74 

Begin quoted string - Pair 1 

EQ 

> 

76 

End quoted string - Pair 1 

BP 

( 

50 

Begin protected string - Pair 2 

EP 

) 

51 

End protected string - Pair 2 

BA 

[ 

133 

Begin "A - syntax" expression 

EA 

1 

135 

End "A - syntax" expression 


Strings of symbols found between the above illustrated 
enclosures are said to be "quoted" or “protected" and are 
completely ignored during the scanning process. 

The two rules that follow are applied to the scanning 
process with respect to the use of "quoting characters". 


I I When an unprotected character designated as a 
II 2 II "quoting character" is encountered in the left 

IJ_[I to right scan of an expression, the other 

character of the pair is then defined as the 
character which will end the quoted string; this means that 
for the two initially designated pairs shown above, quoting 
or protection may also be achieved as follows: 

>....< or ) .... ( 


ll Tl In the process of finding the character which 
II 1 II is to terminate a particular quoted string any 

IJ_[I occurrence of the same character as that which 

identified the beginning of that quoted string 
must be balanced by a corresponding "end of quoted string" 
character. 

This is to be differentiated from the action which takes 
place in connection with the "protected string" of the "S" 
syntactic form: 

! . . . protected string . . . / 

In the foregoing a tally is made of "unquoted" warning 
characters in order to find the slant sign "/■ which 
matches the exclamation mark: 

The tally count is increased by a count of one - % & ! # 

The tally count is decreased by a count of one - / : ; 

It should, however, be noted that the "warning characters" 
(symbols used to delineate bounds of expressions) shown in 
the foregoing illustrations and examples are changeable by 
the user and are only representative of initial or 
standardized conditions. 

Any of the foregoing "warning characters" may be changed 
using the appropriate SAM76 resident function; the 
abbreviations listed earlier are used to identify the 
particular warning character it is desired to change. 


When an unprotected "character quoting 
symbol" is encountered, then the 
immediately following character is 
considered to be quoted. This is 
particularly useful when the user wishes 
to quote single characters, such a 
warning character, without having to 
maintain a balance of quoting character pairs. 

Initially the "character quoting symbol" is set to be the 
"coninercial at" ( @ ). 


I Quoting or |I 
I protecting 11 
I a single I| 
I character I I 


Using the SAM76 syntax, functions, and trace ii 


In both the "S" and "M" forms of SAM76, 
the equivalent of string quotes may be 
provided by any pair of characters 
designated for that purpose. Initially 
two such pairs are defined and consist of 
the following balanced pairs of 

enclosures: 


In the examples that follow the I ... I arrangement is used 
only to delineate output at the user terminal; if for 
instance the user wished to add two numbers making use of 
the "A" syntactic form, the following might be observed: 

[5+5 ]=|10| 


I 

I Quoting or 
I protecting 
I a string 


<....> or ( .... ) 

Page 20 Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 Number 21 

30 









Define Text with id number 


IT T| In the following example the M76 syntax 
I|M76 example I I is used to create a "macro" which when 
|J_|| invoked will square any desired number: 


♦DT,SQ,<#MU,ql,ql;>i- DT means Define Text 

MU means Multiply 
SQ is name given to text 

#PT,SQ,ql:= PT means Partition Text 

There are four possible actions which may ensue when the 
macro, or user defined function named SQ is to be invoked: 


|DT,t,s,dl| 

This function places in the "text area" the string denoted 
by "s" in the expression shown above; this text is given 
the name denoted by "t". An arbitrary identification 
decimal number denoted by "dl" may also be included as part 
of the "text" record. Previously defined text with same 
name is erased and replaced with this definition. 

Examples: 


1. #SQ,5:=|25| 

2. #FT,SQ,5:=1251 


value returned is 25 


M76 #DT,NAME,THE SKY IS BLUE: 


FT - Fetch Text, value 25 


S76 %DT,NAME,THE SKY IS BLUE/ 


3. #SQ,5;=1251 value returned is 25 

4. #FT,SQ,5;I#MU,5,5:I value is Text of SQ 


In the foregoing examples no id. number was desired, and 
consequently the default value of zero is stored as part of 
the record created by this function. 


IT TI The foregoing example is repeated below 

I IS76 example |I making use of the S76 syntax; however to 

|J_[I illustrate its use, the infix system is 

used for the actual multiply function: 

%DT,SQ,![ql * ql]//= ql is dummy variable 

%PT,SQ,ql/= ql becomes partition valu 

e 
1 


The four invocations of SQ are shown below: 


1. 

%SQ,5/=|251 

value 

is 

25 

2. 

%FT,SQ,5/=1251 

value 

is 

again 25 

3. 

&SQ,5/=1251 

value 

is 

still 25 

4. 

&FT,SQ,5/=I( 5*5]l 

value 

is 

now "text" of SQ 


I I In general the mnemonics used in SAM76 to 
I I Resident I I identify the resident functions are 
I I Functions I I composed of two alphabetic characters. 

IJ_[I This is not a restriction imposed on the 

language, and three or more alphabetic 
characters may be used to identify resident functions. In 
fact the user may wish to employ the "@F" ("wh@" (what) 
Functions) mnemonic to ascertain the mnemonics in actual 
being in his system. 

It should be remembered that when the sign serves the 
purpose of "quoting single character" then the expression 
to list the resident functions would be: 

M76 l@@F, ... : 

S76 %@@F, ... / 

where " ... " is the string of characters which will 
precede each resident function name in the result of 
executing this expression. 

Descriptions of the functions and examples in which either 
S76 or M76 syntax is applicable employ the I (Long Vertical 
Mark) character to bound the expression. In actual use the 
I is replaced by the appropriate pair of warning 
characters. 

In the case of "null" valued functions where the neutral 
form of the expression is to be illustrated, the \ 
"reverse slash" is used in lieu of the I. 


Texts in the "text area" may be examined 
without evaluation using the "vt" 
function. This examination will display 
location and value of any "partitions", 
"multi-partitions", and the text 
divider(s) when at a location other than 
the head (or extreme left) end of the text 


II 

1 1 

The "VT" 

II 

II 

1 1 

View Text 

II 

II 

1 1 

function 

II 

II 


Initial conventions for the display within a "text" of 
partitions, multi-partitions and text divider(s) are: 


[1], [2], ... (d) 


Partitions 


[#1], (#2), ... [#d] 


Multi-partitions 


n 


Text Divider 


When in the "Trace" condition, active II Tl 

expression about to be evaluated will be I I Trace 11 

shown bounded by the I, neutral IJ_[I 

expression by \, regardless of the syntax 
(M or S) of the expression. 


IT- 

I I "id" 

I I numbers 

II 


Tl 
11 
11 
II 


The M6 language provides a unique 
identification number for each of the 
resident functions of the language, and 
means for the user to assign a similar 
type of number to defined functions. This 
numbering concept is preserved in SAM76; numbers between 1 
and 99 inclusive are not assigned to any resident SAM76 
function unless its name and operation is absolutely 
identical to its M6 counterpart. This permits user defined 
functions to be written to mimic M6 functions if desired. A 
list of M6 functions and their assigned "id" numbers is 
given in an appendix. 


To illustrate, the M6 function "DEF" 
might be mimicked in the SAM76 system as 

II 

1 1 

User 

1 1 
II 

follows: 

II 

defined 

II 

la. %DT,DEF, !%NI,<&>,<%>/DTtnpl</>// 

II 

1 1 

function 

II 

II 


2. %MP,DEF,mpl/ 

examination of the defined text (or function) DEF can be 
made using the SAM76 "VT - View Text" resident function 
thus: 


3. %VT,DEF/= | %NI ,<&> ,<%>/DT(#l] </> I 


The formal description of the "DT" - "Define Text" function 
is given below to illustrate the manner of presenting SAM76 
resident functions. 


in the foregoing ”mpl" is a dummy for a "multi-partition" 
which will be created by the second expression and 
visualized by the VT function as [#1]. 


Number 21 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 21 


31 












The function "NI - Neutral Implied" is used to provide the 
expression using DT with either the active or neutral 
warning character as used with an expression containing 
"DEF" as its operative argument. 


Alternatively expression (la) could have been written in 
one of the following ways,with exactly the same end effect: 

lb. %DT,DEF,<%NI,@&,@%/DTtnpV>/ 

lc. #DT,DEF,<#NI,@%:OTnpl/>: 

l d. #DT,DEF,<#DTtnpl%NI,@:,@:/>: 

le. #DT,DEF,<#DTmpl#NI,<;>,<:>:>: 



Algorithms in the SAM 76 Language 


Tl 

II 

II 


ll TI In the algorithms described and 

I I introduction II illustrated in this section, use is made 

|J_U of the procedure named "print" to 

display the script of the functions, 
expressions, and other text strings. 

The "print" function is useful in that it augments the 
capability of the "vt - view text" function by prefixing 
each individual "text" displayed with its name bounded by 
angle brackets; assuming that texts have been created as 
shown: 

tr.—-. 

{} %dt,a,apple/= 

0 %dt,b,bottle/= 

{} %pt,b,t/= 

{} 


The use of "print" would cause the following display: 

< a > 

apple 

< b > 

bo[l][1]le 

The need and use of the "print" ll Tl 

expression was described earlier; the 11 print jI 

expression to accomplish this task uses |J_[I 

a multi partition value #2. 

Typical use to print out name and contents of the text area 
which in this example only contains the "print" expression 
would be: 

Tl.-. 

{} *print%lt,(,)//= 

{) < print > 

{} %ii,[1],,,!os, 

{} « [1] »/%vt,[l]/*os, 

{} /Iprint[#2]/// 

{) 


A simple way of doing some procedure 11 Tl 

"proc" some desired "n" number of times 11 do "n" Times I I 

is exemplified by the use of "ds - IJ_[I 

duplicate string" in the expression 
named "dnt": 

< dnt > 

%ds,[1],!%proc/// 


The simple recursive function named ll Tl 

"fac" generates the factorial of any 11 factorial 11 

number which replaces partition value 1 1 1 _[I 

in its use. 


< fac > 

%ig,l,[1],1,!%mu,[1],%fac,%su,[1],1///// 

TT.. 

{) %fac,5/=120 

U 


This recursive function named "exp" is 11 

used to generate the exponential of "m" 11 exponential 11 

to the "n"th. power; in use "m" replaces IJ_[I 

partition value 1, and "n" partition 
value 2. 

< exp > 

%ig,[2],,!%mu,[1],%exp,[1],%su,(2),1////,1/ 

n. 

{} %exp,3,7/=2187 

U 


The recursive expression named "mrn" 
extracts the "m"th. root of any number 
“n"; it should be noted that this 
function makes use of the expression 
named "exp", which generates an 
exponential. 


II II 

I I "m"th. I I 
I | root of "n" I I 


< mrn > 

%ig,%exp,[3],[2]/,[1], 
!%su,[3],l//, 

!%mrn,(1],[2],%ad,[3],1//// 

TT. 

0 %mrn,2187,7/=3 

{} 


Expression named "tensor" is used to ll Tl 

generate a list of successive numbers 11 tensor 11 

separated by the size of the list IJ_H 

is specified by the integer number which 
replaces partition value 1 in the expression. 

< tensor > 

%ig,[1],l,!%tensor,%su,[1],1//.[1]/,1/ 


A frequently needed capability is that 
of generating "roman" numbers, as for 
text section and chapter headings; when 
function "dtr" is invoked with a decimal 
number as its argument, the value 
returned is the same in roman notation. 

Thanks are extended to Jim Gimpel, of the Bell Telephone 
Laboratories for suggesting this as a most useful adjunct 
to the SAM76 language, as it is to the SNOBOL language. 


1 

1 

Decimal 

"Tl 

II 

1 

to 

II 

1 

1 

Roman 

II 

II 


Page 22 Dr. Dobb's Journal of Computer Calisthenics 8i Orthodontia. Box E, Menlo Park, CA 94025 


Number 21 


32 















<; atr > 

%dt,x, [l]/%roml/%y/%et,x,y,z/ 

< roml > 

%ig,%crd,x/,,!%rom2,*fc,x//%roml/// 

< rom2 > 

%dt,z,[l]/%pt,z%d//*dt,z,%z% r///%pt,y*u//*dt,y,%y% t//% z// 

< d > 

,0,1,2,3,4,5,6,7,8,9 

< r > 

,,I,II,III,IV,V,VI,VII,VIII,IX 

< u > 

,I,V,X,L,C,D,M 

< t > 

,X,L,C,D,M,*,§ 


< hanoi > 

%ii,[1),0,,!%hanoi,%su,[1],1/,[2],[4],[3]/! 

Move Ring [1] from [2] to [3]/ 

%hanoi,%su,[l],l/,[4],[3],[2]/// 

Given the need to move four rings from "hither" 4^®-yon", 
using "thither" as a way station, the monks needed only to 
follow the following sequence to do the task in a minimum 
length of time: 

tr. 

{} %hanoi,4,hither,thither,yon/= 


(} 

Move 

Ring 

1 

from 

hither 

to yon 

{} 

Move 

Ring 

2 

from 

hither 

to thither 

u 

Move 

Ring 

1 

from 

yon to 

thither 

{} 

Move 

Ring 

3 

from 

hither 

to yon 

{} 

Move 

Ring 

1 

from 

thither 

■ to hither 

{} 

Move 

Ring 

2 

from 

thither 

to yon 

{} 

Move 

Ring 

1 

from 

hither 

to yon 

{} 

Move 

Ring 

4 

from 

hither 

to thither 

{} 

Move 

Ring 

1 

from 

yon to 

thither 

{} 

Move 

Ring 

2 

from 

yon to hither 

{) 

Move 

Ring 

1 

from 

thither 

■ to hither 

{} 

Move 

Ring 

3 

from 

yon to 

thither 

(} 

Move 

Ring 

1 

from 

hither 

to yon 

(} 

Move 

Ring 

2 

from 

hither 

to thither 

{} 

Move 

Ring 

1 

from 

yon to 

thither 


{} 


The “hex" freak can fulfill his desires 
by defining the "htr" expression to 
achieve "hex to roman" conversion: 


II II 

I I hex to roman I I 

II II 


< htr > 

%dtr,%xd,[1]// 


The user often finds it necessary to I I 
derive a series of answers resulting 11 loop 

from the execution of some script for a IJ_[I 

range of numbers "nl" to "n2"; the 
script loop provides this capability by enabling the user 
to specify for partition 1 the name of the function, the 
lower of the two numbers "nl" as partition 2 and the higher 
number "n2" as partition 3. 

< loop > 

%zs,6,[2]/%zs,7,%su,[3],[2]//%zi,7/%lpl,[1]/ 

< lpl > 

%lp2,[1],%zq,6//%zi,6/%zd,7,,,l%lpl,[1]/// 

< lp2 > 

i 

/%ps,-4, ,[2]/ %[1],[2]/ 

For example the user wishes to ascertain the "roman" number 
equivalent of the decimal numbers from 105 to 116: 

TT.-. 

{} %loop,dtr,105,116/= 


n 

105 

CV 

u 

106 

CVI 

u 

107 

CVII 

u 

108 

CVIII 

u 

109 

CIX 

u 

110 

CX 

n 

111 

CXI 

u 

112 

CXI I 

u 

113 

CXI II 

o 

114 

CXIV 

(j 

115 

cxv 

0 

116 

CXVI 


U 


The expression named "hanoi" is a 
classical example of recursive 
capability; although the original is 
said to be based on monks moving rings 
between the three towers of Bhrama, the 
to be better known for this puzzle. 

The expression shown below was conceived by Dick Stone; it 
solves the problem, with a minimum number of moves: 


Often times it is desired to execute all II 

procedure on each and every one of some 11 repeat 11 

arbitrary number of "texts" in the IJ_[I 

storage area; as an example a script 
designed to provide a list of text names and the count of 
characters in each text will be illustrated; the key to 
this script was the use of "mt - multi part text"; it was 
used to create the multi partition value "#2" seen in the 
expression named "repeat". 

< repeat > 

%ii,[1],,,!%procl,[l]/%repeat[|2]/// 


< procl > 

%os, 

%ps,10, ,[l]/%ps,-5, ,%crd,[1]/// 

If, for instance, the only texts in the text area were 
"repeat" and "procl", then the use of repeat with an "It - 
list text function" would appear as follows: 

TT. 

{} %repeat%lt,(,)//= 

{} repeat 26 

{} procl 32 

{} 


The "skim" expression "skims off" the |1 Tl 

first appearance of each different 11 skim 11 

character of the string which is placed |J_[I 

as an argument to the expression; the 
result is returned as the value. 

< skim > 

%dt,,![l]//*rs,%i//%et,/ 

< i > 

%ig,%crd,/,,!%k,&fc,//// 

< k > 

% P t, ,[l]/%i,[l]/![l]/ 

A simple example of the use of "skim" follows; 

TT'... 

{} %skim,MISSISSIPPI/=MISP 

U 


ii-Tl 

11 hanoi 11 


name "hanoi" seems 


Number 21 


Dr. Dobb's Journal of Computer Calisthenics 8t Orthodontia, Box E, Menlo Park, CA 94025 


Page 23 











Increments in X and Y 


In his book "Algorithms in SNOGOL4" Jim Gimpel, the author, 
offers SKIM as an example of string manipulation; it is 
interesting to note the typing effort required for the same 
function in each language; it is assumed that a speed of 
ten words per minute (or one character per second) is 
reasonable for intellectual typing. At that rate the SAM76 
script would take approximately 100 seconds, while the 
SN0B0L4 example would require approximately 143 seconds to 
typo up* 


SAM 76 Language Functions 11 


The SAM76 language functions described in the following 
pages represent a first draft for test and evaluation 
purposes, and include all of the functions available in a 
processor for that language initially coded for the INTEL 
8080 and Zilog Z-80 microprocessors. 

In particular these functions properly represent the action 
expected for processors which have the <ncra> 
identification; see function [@n). 

Ttie references listed below should be used to provide 
information as to language syntax, method of use, and 
applications: 


1. "SAM76 - A language based on I I II 

"Strachey's GPM and Me Ilroy's M6", II References II 

by Claude A. R. Kagan, dated august |J_[I 

1976, and available as report R 

76-301 from the IEEE Computer Society, 5555 Naples Plaza, 
Long Beach, CA, 90803. 

2. "SAM76 Language Primer" to be published. 

3. Notes on loading and using SAM76, from the Amateur 
Computer Group of New Jersey. 

The author would greatly appreciate feedback, particularly 
if errors are found in this document, or if the definitions 
do not seem to correspond to the action encountered in a 
given processor. 


xnl,ynl, ... xn,yn 

con Condition 

EQ Equal 

GT Greater Than 

LT Less Than 

ZE Zero 

GE Greater than or Equal 

LE Less than or Equal 

UC Upper Case 

LC Lower Case 

When a radix greater than 10 is used upper case alphabetic 
symbols represent the ensuing integers starting with "A" 
being equivalent to 10 in base 10, "B" to 11, and so on. 
Lower case characters are used when the radix exceeds 36. 


II-- 

I I Function Definitions 

II _ 


238 - |@f,s0| wh@ are Functions 

The value of this function is a list of built-in functions 
available within the system. Each function mnemonic is 
preceded by the string of characters symbolized by "sO". It 
is advisable to use the "neutral" form of expression as 
shown below: 

&@@f, /={value will be list of functions) 

Note use of two since that symbol is a warning 
character it must be protected, and in the above example it 
is . used as the single character protector to protect 
itself. 


239 - I@nI wh@ is processor ser. Number 

The value returned through execution of this function is 
the version number of the processor being used. This number 
is tested by some of the functions - and may also be so 
tested by the user - to ascertain c xnpatibility between 
scripts and run time load modules that may be moved between 
systems and users. 


Ancelme Roichel 
Box 257 - RR1 
Pennington - N. J., 08534 


Notation used in list of functions 


# Preliminary definition - no ID number assigned 

I function,argl,arg2,...,argn| Active form of execution 
\function,argl,arg2,—,argn\ Neutral form of execution 

@ "at" (wh@ means "what") 


c2,cl, .. 

,. ,c 

Single characters 

s2,sl, .. 

.. ,s 

Character strings 

sO 


Prefixing character string 

t2,tl, .. 

.. ,t 

Names of Texts 

f2,fl, .. 

.. ,f 

Names of Files 

d2,dl, .. 

.. ,d 

Decimal Numbers 

n2,nl, ., 

.. ,n 

Numbers in current radix 

x2,xl, . 

.. ,X 

Binary numbers (octal/hex) 

vz 


Value if function fails 

vt 


Value if function True 

vf 


Value if function False 

vO 


Value if function zero 

v+ 


Value if function positive 

V- 


Value if function negative 

dev 


Device 

a2,al, . 

.. ,a 

Abbreviations 


237 - |@t| wh@ is processor Title 

The value of this function provides information as to the 
authorship of the processor being used; a typical example 
is: 

&@@t/=<ncra> indicating that the authors are: 
"Neil Colvin Claude Roichel Roger Amidon. 


159 - Iab,sl,s2,vt,vfI Alphabetic Branch 

This function compares the character strings denoted by 
"si" and "s2" in terms of their "ASCII" binary value; if 
the string "si" has a lesser value than the string "s2" 
then the value of the expression is the string denoted by 
"vt", else the value is the string denoted by "vf"; if the 
value strings are expected to contain executable or 
syntactically meaningful symbols they should be protected 
within the expression. 

128 - Iad,nl,n2,n3,...,n| Add 

The value of this expression is the arithmetic sum of the 
integer numbers denoted by "nl", "n2", ... "n". Each of the 
arguments is examined from right to left until a symbol not 
representing a valid number in the current number base is 
encountered; non numeric symbols prefixing the arguments 
are ignored with the exception of those in argument "nl" 
which is carried into the value string of the expression. 


Page 24 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 21 


34 



For example: 


148 - |cld,t| 


Characters Left of Divider 


%ad,dog5,cat6/={dogll) 

Negative numbers are indicated in the usual manner with a 
sign which must immediately precede the string of 
integers it applies to thus: 

%ad,dog-5,cat6/={dogl) 

Omitted arguments (such as adjacent commas) have the value 
of the "null string" and a numeric value of zero (0) as 
illustrated in the following example: 

%ad,dog,/={dog0} 


160 - Iai,s0,sl,s2,_,s| Alphabetic Insertion 

Hie value of this function is a character string in which 
the string denoted by "si" has been inserted ahead of the 
first of the subsequent argument string which has a greater 
alphabetic value; each of the strings which form the 
arguments of the expression are returned with a copy of the 
string symbolized by "sO" preceding it. 

187 - |and,xl,x2| And the bits 

The value of this function is the result of performing an 
anding of the two binary numbers represented in the current 
"X" base by "xl" and "x2". 


161 - |as,s0,sl,s2,...,s| Alphabetic Sort 

The value of this function is a character string in which 
the sequence of the strings denoted by "si", "s2", ... "s" 
is rearranged to be in proper alphabetic sequence; each of 
these strings is preceded by the string denoted by "sO” in 
the result: 

%as,(,),horse,cat,dog/=(,dog,cat,horse} 

Note the use of "(,)" for "sO"; this is typical of lists 
that the user may wish to use in a variety of functions 
which have arbitrary number of arguments. 

220 - |bf,f,vz| Bring File 

Execution of this function serves to bring from auxiliary 
storage the file whose name is denoted by "f"; if this file 
does not exist, then the value of the function becomes the 
string symbolized by "vz". 

113 - lca,s| Change Activator (current) 
\ca,s\ Change Activator (initial) 

The purpose of this function is to change the symbol which 
terminates input from its current value to that denoted by 
the first character of the string denoted by "s"; active 
form is used to change the operational activating character 
whereas the neutral form is used to change the initial 
table. 


195 - |cfc,dl,s| Change Fill Character schema 
\cfc,dl,s\ Change Fill Char, (initial) 

The purpose of this function is to enable the user to 
specify the number of that character which is the first one 
of the string denoted by "s" that will be automatically 
output at the beginning of each "new line"; usually these 
will be "nulls" but they may be any other character the 
user wishes to use. Active form of the expression changes 
the table in active use, while the neutral form changes the 
initial table; see [cnb]. 


193 - lcin,tl,dl,...,t,d| Change Id Number 
To be defined and coded. 

Number 21 


The value of this function is the (decimal base) number of 
characters located between the beginning of the "text" 
whose name is denoted by "t" and the current location of 
the internal "text divider" of said text. 


191 - |cll,d| Change Line Length (active) 
\cll,d\ Change Line Length (initial) 

The purpose of this function is to change the number of 
characters that the processor will output before 
automatically inserting a "new line" code; the desired 
value is the decimal number denoted by "d" in the 
expression; the active form changes the actively used 
constant, while the neutral form changes the initial 
condition table; see [cnb]. 


133 - |cnb,d| Change Number Base (active) 
\cnb,d\ Change Number Base (initial) 

The purpose of this function is to change the radix of the 
processor's arithmetic functions; this is always expressed 
as the decimal number symbolized by "d" in the expression; 
see [qnb]; active form of the expression changes the value 
of the radix used during the actual operations while the 
neutral form changes the initial table. Note that the 
neutral change can only be effective while the processor is 
in unprotected memory, and will have no effect if the 
processor is executed from read only or protected memory. 


266 - |cpc,tl,dl,...,t,dI Change Protection Class 
To be defined and coded. 

147 - |crd,tl Characters Right of Divider 

Hie value of this function is the (decimal base) number of 
characters located between the beginning of the "text" 
whose name is denoted by "t" and the current location of 
the internal "text divider" of said text. 


203 - |cro,sl| Change Rub Out char, schema 
\cro,sl\ Change Rub Out (initial) 

The purpose of this function is to permit the user to 
specify as the first character of the string denoted by 
"si" that symbol desired to serve the character delete 
function; in addition the user may specify the next two 
characters of that string to be output before and after, 
respectively, the deleted string of characters. The active 
form changes the user table, while the neutral form of this 
function changes the initial table; see [cnb). 


132- |ct,tl,t2,t3,...,t| Combine Texts (superseding) 
\ct,tl,t2,t3,...,t\ Combine Texts (save current) 

The purpose of this function is to create a text, whose 
name is denoted by "tl” which will contain the 
"concatenation" of the texts whose names are denoted by 
"t2", "t3", ... "t". 

The active form of the expression will also delete the 
current text named "tl" if any; the neutral form of the 
expression will not cause deletion of any pre-existing 
texts. 


250 - |cwc,sl| Change Warning Character 

\cwc, ... \ Change Warn. Char, (initial) 

The purpose of this function is to allow the user to select 
other symbols for syntactic purposes than those initially 
defined in the language; see [gwc]. The active form of this 
function changes the current user tables while the neutral 
form changes the initial table; see [cnb]. 

Page 25 


Dr. Dobb’s Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


35 



261 - |cws,d| 
\cws,x\ 


Define Text (superseding) 
Define Text (save current) 


Change work Space 


This function allows a respecification of the upper limit 
of space required for function execution and text storage; 
the neutral form is used to allow a binary (hex, octal ... 
) number denoted by "x" to be entered; the active form uses 
the decimal nunber system instead; see [qws]. 


171 - |cx,sO,s| Character to "X" 

This function returns as a value a sequence of binary 
numbers, each preceded by the string denoted by "sO" which 
result from converting the character string denoted by "s"; 
the conversion is in the current specification for the "X" 
base; see [cxb, qxb, xc]. 


200 - |cxb,d| Change "X" Base (active) 
\cxb,d\ Change "X" Base (initial) 

Through use of this function, the user may change the 
specification of the radix (or base) for those functions 
which operate in the "X" base; "d" symbolizes the decimal 
value of the desired new radix, and this should normally be 
either "2" or "4" or "8" or "16"; active and neutral forms 
operate with respect to the "X" base in the same manner as 
described for the "cnb - change number base" function. 


103 - Idt,t,s,dl,d2| 

\dt,t,s,dl,d2\ 

This function is used to create a "text" whose name is 
denoted by "t", containing the string of characters 
symbolized by ”s"; arguments denoted by "dl”, "d2" are for 
undefined purposes. 

The active form of the expression serves also to erase the 
text whose name is "t" if currently in the text area; the 
neutral form will not cause any text deletion. 


173 - |dx,d,x| Decimal to "X" 

The value of this function is that number which results 
from converting the decimal number denoted by "d" to its 
equivalent in the current "X" base; the argument symbolized 
by "x" is undefined; see [xd, cxb, qxb]. 


206 - |ea,tl,t2,_,t| Erase All excepting 

This function is used to erase from the text area all 
defined texts; excepted from this erasure are the texts 
whose names are denoted by "tl", "t2", ... "t"; full 

erasure is accomplished as shown below: 

%ea/= 


259 - |da,s0| Date 

The value of this function is the current calendar date in 
the sequence of "day, month, and year"; each of these 
elements is preceded by the string of characters denoted by 
"sO”. 

The date may be either user entered (using the "sda" 
function) or may be automatically generated by a system 
clock or calendar; see [sda]. 


131 - |di,nl,n2,vz| Divide 

The value of this function is the integer result of 
dividing the number denoted by "nl", by the second number 
denoted by "n2"; if the result of the division would be 
indeterminate - "n2" = zero - then the value of the 

expression is that string denoted by "vz". 

Treatment of non numeric, signs, and null strings is 
identical to that described in the "ad" function. 


208 - |dq,s| Define Quote 

The purpose of this function is to enable the user to 
specify the character that is to be recognized by the scan 
algorithm as an unconditional protecting character. To be 
further defined. 


- ldr,t,a,o,v| Define Relationship 

To be defined and coded. 


164 - |ds,d,s| Duplicate String 

The value of this expression is a concatenation of that 
number of copies of the string "s" which is denoted by the 
decimal number "d". 

This function may be quite properly used to "DO" something 
a desired number of times as illustrated below: 

%ds,5,!%dt,x,%ad,3,%x/////= 

This example shows a most awkward way of creating a text 
named "x" which contains the product of 5 and 3. 


207 - |ed,t,dl,d2,vz| Extract "D" characters 

The value of this function is a string of characters 
extracted from the text whose name is denoted by "t"; the 
first character returned is that which is found distant to 
the right of the text divider by the number denoted by 
"dl”, and the number of characters returned is denoted by 
the number "d2". 

If there are absolutely no such characters available then 
the value of the expression is that string denoted by "vz" 
which is always treated actively; this is regardless of 
whether the original expression was used actively or 
neutrally. 


224 - |ef,fl,f2,...,f| Erase Files 

This null valued function is used to erase from auxiliary 
storage the files whose names are denoted by "fl", "f2", 
... ”f". 


151 - |ep,t,pl,p2,...,p| Erase Partitions 

This function serves to delete from the text named "t" any 
partitions that may be found in it to the right of the 
internal text divider. 

If arguments "pi", "p2", and so on are specified, then only 
those partitions with values denoted by these arguments are 
deleted. 


- ler, ... I 

To be defined and coded. 


Express Relationship 


104 - |et,tl,t2,...,t| Erase Text 

\et,tl,t2,...,t\ Erase all occurences of Text 

This function is used to erase from the text area texts 
whose names are denoted by the arguments of the expression; 
the active form of the expression erases only the latest 
version of the named texts, should more than one version 
exists in the text area. 


Page 26 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 21 



249 - |etb,s| 


Fetch "D" Matches 


Erase Trailing Blanks 

This function, which Neil Colvin insisted be made 
available, serves to delete from the character string 
symbolized by ”s" all blanks which immediately precede the 
occurence of "new line' 1 codes; particularly useful when 
reading punched cards with many trailing blank columns. 


112 - lex,f| Exit 

This function is used to exit from the processor back to a 
system monitor; if the expression contains any arguments, 
such as "f” then a file is created in auxiliary storage 
which contains all of the user work space including 
variables, working area and text area. 

This file is given the name denoted by "f", and may be 
reloaded on any other system and the action interrupted by 
the execution of this function is then resumed at the same 
point. 

Successful resumption of action is subject to compatibility 
as determined by verification of the system authorship and 
version number. 


226 - |fb,f,vt,vf| File Branch 

The value of this function is the string symbolized by "vt" 
if the file whose name is denoted by "f" is to be found in 
external storage; if not the value of this function is that 
string symbolized by ”vf". 


137 - lfc,t,vz| Fetch Character 

The value of this function is the character to be found 
immediately to the right of the internal text divider of 
the text whose name is denoted by "t"; if such a character 
exists then the text divider is advanced to point to the 
next available character - or alternatively to the end of 
the "text". 

If no character is available then the value of the 
expression is that string denoted by "vz" which is always 
treated actively. 

138 - |fdc,t,d,vz| Fetch "D" Characters 

The value of this function is that decimal number of 
characters denoted by "d" which is to be found to the right 
or left of the internal divider of the text whose name is 
denoted by "t"; a positive number specifies to the right, 
and a negative number to the left; the text divider is then 
relocated to point to the next character available if to 
the right, or to the first character returned in the value 
string if to the left. 

Should there be absolutely no characters (not even one) 
available for the value, then ”vz" represents the string 
which will be returned as the value of the expression, and 
this value is always treated actively. 


139 - |fde,t,d,vz| Fetch "D" Elements 

The value of this function is that string of characters to 
the right or left of the text divider of the text whose 
name is denoted by "t" which comprises the number of 
elements specified by the decimal number "d"; an element is 
that which is found between partitions. 

The divider is then moved either to the right or left to 
point either to the next character to be read (if to the 
right) or that character which corresponds to the first 
character of the value string (if to the left). 

If absolutely no characters are returned, then the divider 
is not moved and the value of the expression is that string 
symbolized by "vz" which is always treated actively. 


140 - |fdm,t,d,s,vz| 

The value of this function is a character string taken to 
the right of the text divider of the text whose name is 
denoted by "t"; the contents of the text "t" is scanned 
searching for occurences of the string denoted by "s"; when 
that number of occurences equal to the number ”d" is found 
then the divider is relocated to point to the next 
immediately following character, and the value string is 
that which lies between the old and the new divider 
locations. 

If the required number of matches is not found, then the 
divider is not moved, and the value of the expression is 
that string denoted by "vz", which is always treated 
actively. 

If the desired number is negative, then the action takes 
place to the left of the divider instead of to the right. 


141 - |fe,t,vz| Fetch Element 

The value of this function is that string of characters 
which is to be found immediately to the right of the 
current location of the divider in the text named "t" up to 
the next encountered partition - or end of text. 

The text divider is moved to point to the immediately 
available next character. 

If absolutely no characters are to be found, then the value 
is the string denoted by "vz", which is always treated 
actively. 


142 - |ff,t,d,vz| Fetch Field 

The value of this expression is that string of characters 
to be found to the right of the first occurence of a 
partition of value symbolized by "d" until the next 
partition is encountered, or to the end of the text named 
"t"; the divider is then moved to point to the next 
available character. 

If absolutely no characters are returned, then the divider 
is not moved, and the value of the expression is the string 
symbolized by "vz" which is always treated actively. 


143 - |fl,t,s,vz| Fetch Left match 

The text named "t" is searched to the left of its internal 
divider for a string identical to that denoted by "s"; if 
such a string is found then the divider is moved to point 
to the first character of that string and the value of the 
expression is that group of characters to be found between 
the new location of the divider and its old location. 

If no such matching string is found, then the divider is 
not moved, and the value of the expression is the string 
"vz" which is always treated actively. 


145 - |fp,t,xl,...,x| Fetch Partition 

The value of this function is the next partition to be 
found in the text whose name is denoted by "t"; the text 
divider is moved to point to the next ensuing character. 


144 - |fr,t,s,vz| Fetch Right match 

The text named "t" is examined starting at the current 
location of the text divider for a string identical to that 
denoted by "s"; if such a string is found, then the divider 
is moved to the next character which follows this string 
(or the end of the text) and the value returned is that 
string of characters which lies between the old and the new 
locations of the text divider. 


Number 21 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 27 



If no such match is found, then the value of the expression 
is the string denoted by "vz", always treated actively, and 
the divider is not moved. 


106 - Ift,t,sl,s2,...,sI Fetch Text 

Hie value of this function is the contents to be found in 
the text named "t" to the right of its internal text 
divider. 

Any partitions found in that portion of the text are 
replaced with the strings denoted "si", "s2", ... "s", in 
such a manner that partitions with value "1" are replaced 
by "si", value 2 with "s2" and so forth. 


115 - IicI Input Character 

Hie value of this function is one character the source of 
which is the currently selected input device; this may be 
absolutely any one single character in the system character 
set. 


116 - |id,d| Input "D" characters 

Hie value of this function is a stream of characters from 
the current selected input device; the action is terminated 
when that number symbolized by "d" has been received; in 
the case of certain sources, an End of File will also 
terminate. 


210 - |ftb,t,s,vz| Fetch To Break character 

Hie value of this function is a string of characters taken 
from the current location of the internal text divider of 
the text whose name is denoted by "t" to the first ensuing 
character in text "t" which is found in the string 
symbolized by "s"; the text divider is moved to the first 
character which follows that which terminated the scanning 
action. 

If no character is returned, then the divider is not moved 
and the value of the expression is that string symbolized 
by "vz" which is always treated actively. 


211 - |fts,t,s,vz| Fetch To Span character 

Hie value of this function is a string of characters taken 
from the current location of the internal text divider of 
the text whose name is denoted by "t" to the first ensuing 
character in text "t" which is not found in the string 
symbolized by "s"; the text divider is moved to point to 
the first character which follows that which terminated the 
scanning action. 

If no character is returned, then the divider is not moved 
and the value of the expression is that string symbolized 
by "vz" which is always treated actively. 


212 - |hc,s| How many Characters 

Hie value of this function is the actual number of 
characters comprising the string symbolized by "s". 


150 - |hm,t,s| How many Matches 

Hie value of this function is that number of occurences of 
the string of characters symbolized by "s" in the text 
whose name is denoted by "t". 


149 - |hp,t,d| How many Partitions 

The value of this function is the number of partitions to 
be found to the right of the text divider in the text whose 
name is "t"; if there is no explicit third argument, then 
the value represents the total number of partitions; if 
argument three is specified, then the value is that number 
of partitions whose value is eoual to the number symbolized 
by "d". 


114 - |ht,t| Hide Text 

\ht\ Hide all Texts 

Hie purpose of this function is to put a screen or fence in 
the text area such that only those texts created after that 
whose name is denoted by "t" are available. 

This fence is removed by execution of this function with no 
arguments; if it is desired to conceal all of the text 
area, the the neutral form is to be executed. 


153 - |idt,d| Input "D" Texts 

Hiis function serves to place into the text area "texts" 
which are loaded from various types of auxiliary storage 
media and created through use of the "output text" 
functions. 


136 - Iig,dl,d2,vt,vf| If Greater 

Hiis expression compares in an arithmetic sense the two 
strings denoted by "dl" and "d2"; if the value of "dl" is 
greater than that of "d2", then the value of the expression 
is that string symbolized by "vt", else the value is that 
string symbolized by "vf". 


135 - Iii,sl,s2,vt,vf| If Identical 

Strings symbolized by "si", and "s2" are compared, if found 
to be absolutely identical, then the value of the 
expression is that string symbolized by "vt"; if not 
identical the value is the string symbolized by "vf". 


117 - Iim,sl,s2,...,s| Input to Match 

Hie value of this expression is a stream of characters 
coming from the currently selected input device; 
termination of this stream occurs as soon as one of the 
strings symbolized by "si", "s2", ... "s" has been 
encountered; the value includes the string that caused 
termination. 


102 - |is,dev| Input String 

Hie value of this function is a stream of characters coming 
from the currently selected input device; termination 
occurs as soon as the currently specified "activating 
character" is encountered; this activating character does 
not become part of the value string of the function. 


152 - |it| Input Text 

Hie purpose of this function is to place in the text area 
one text loaded from some auxiliary storage media, which is 
in the format generated through use of tne "output text” 
functions. 


213 - |iw,nl Input Wait 

Hiis function sets up an internal timer which becomes 
effective for the next ensuing input function, such as 
"is", "ic", "idc", "im"; automatic termination of the input 
process takes place at the end of the specified time 
interval even though normal terminating conditions 
specified for these functions may not have been met. 

Hie duration of the time interval is specified by "n" which 
is in seconds. 


Page 28 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 21 


38 



- |lef,dev| 


Load External Function 


To be defined and coded. 


If that last previously executed implied "fetch" was 
active, then the value of this function is that string 
symbolized by "vf". 


216 - IIf,sO,dl.dl List Files 

The value of this function is a list of the names of the 
files in auxiliary storage; each file name is preceded by 
the string symbolized by ”s0”. 

Additional arguments are to be defined. 

- Hr, ... | List Relationship 

To be defined and coded. 


188 - |not,x| Not (complement) the bits 

The value of this function is the complement of the binary 
number (in the current "X" base) symbolized by "x". 


209 - |nu,sl,s2,...,sl Null 

The purpose of this function is to cause execution of the 
function whose name is denoted by "si", with appropriate 
arguments n s2", ... "s"; that function is executed but any 
resulting value string is suppressed. 


105 - IIt,s0,dl,d2,...,d| List Texts 

The value of this function is a list of the names of the 
texts to be found in the text area; each name is preceded 
by the string symbolized by "sO". 

Arguments symbolized by "dl", "d2", ... have not been 

defined. 


110 - lmc,d| Multi-partition Character 

The value of this function is the "multi-partition 
character" whose value is denoted by the decimal number 
"d". 


146 - |md,t,d| Move Divider to pos. "d" 

\md,t,d\ Move Divider "d" increments 

This function is used to move the text divider in the text 
whose name is denoted by "t". Active form serves to move 
the divider the number of positions from the left end of 
the text if "d" is positive, or from the right end if 
negative; the neutral form is used to advance or retreat 
the divider from its current location that number of 
positions specified by the number "d". 

It should be noted that these moves are positional and do 
not distinguish any difference between partitions and 
characters; this is the only function available to position 
the text divider other than immediately preceding a 
character. 

109 - |mt,t,sl,s2,...,s| Multi-part Text all matches 
\mt,t,sl,s2,...,s\ Multi-part Text next match 

This function serves to replace in the text whose name is 
denoted by "t" the strings symbolized by "si", "s2", "s" 
with multi-partitions of values respectively "1", "2", ...; 
the neutral form of this function only replaces the first 
occurence of these strings found in the text. 


130 - |mu,nl,n2,vz| Multiply 


246 - loj,s,sl,d,s2l Output Justified lines 

To be defined and coded. 


248 - |op,s,sl,d,s2| Output Paddded lines 


To be defined and coded. 


186 - |or,xl,x2| Or the bits 

The value of this function is the logical or of the two 
binary number strings "xl" and "x2" expressed in the 
current "X" base. 


101 - |os,s| Output String 

This function causes the selected output device to output 
the string of characters symbolized by "s". 


154 - |ot,tl,t2,...,tI Output Texts 

This function outputs to the selected channel, the texts 

whose names are denoted by "tl", "t2", _ "t", in a format 

which preserves all of the internal conditions of the text; 
this includes location of the internal text divider, and 
text partitions if any. 


108 - lpc,d| Partition Character 

The value of this function is a "partition character" of 
value symbolized by the decimal number "d". 


174 - Ipl,sl,s2,...,s| Plot 

This is a general purpose plotter or display control 
function; details may vary in its use as a function of the 
system in which it is used. Certain subfunctions as 
described below have been standardized: 


The value of this function is the arithmetic product of the 
numbers symbolized by "nl", and "n2". The same rules as to 
sign and non numeric matter apply for this function as they 
do for the "ad" function. 


Should there be an overflow condition arise as a result of 
the execution of this function, then the value of the 
expression is that string symbolized by "vz". 


Ill - |ni,vt,vf| Neutral Implied 

This function returns the string symbolized by "vt" if the 
last previously executed implied "fetch text" was neutral. 


Ipl,lf,s0l 
I pi,as,port,time I 
I pi,nm| 

|pl,vm| 

lpl,cal| 

|pl,tek| 

lpl,mq,x| 


List of Plotter subfunctions 
Assign output port and time delay 
Output plotter control information 
Return as value control information 
Set up for "Calcomp" plotter 
Set up for "Tektronix" display 
Rotate to quadrant "x" 


162 - Ips,d,sl,s2| Pad String 

The value of this function is the string "s2" to which is 
added either to its right or to its left enough 
duplications of string "si" so that the total size of the 
value string becomes equal to the number symbolized by "d"; 
positive values of "d" pad to its right, and negative 
values to its left. 


Number 21 


Dr. Dobb's Journal of Computer Calisthenics 8i Orthodontia, Box E, Menlo Park, CA 94025 


Page 29 


39 


107 - Ipt,t,sl,s2,...,sl Partition Text all matches 

\pt,t,sl,s2,...,s\ Partition Text next match 

The purpose of this function is to replace in the text 
whose name is denoted by "t" the strings symbolized by 
"si", "s2", ... "s” with partitions identified by numbers 

which correspond to the position of the strings in the 
expression; that is to say "si" is replaced by a partition 
value "1", "s2" by partition value "2" &c. 

In its active form, this function serves to replace all 
occurences of the desired strings; in its neutral form only 
the first occurence found is so replaced for each of the 
specified strings. 

Action takes place starting at the current location of the 
internal text divider which is not moved by this function. 

A particular example of interest might be: 

&pt,animal,dog,dog,dog,dog/= 

This example would in the text whose name was animal, 
replace the first match with "dog" with partition value 
"1", the second, "2", the third with ”3" and the fourth 
with "4". 

196 - Iqfc,s0| Query Fill Character schema 

The value of this function is the current specification for 
the optional fill character output immediately after each 
"new line"; the parameters are each preceded by the string 
symbolized by "sO"; see [cfc]. 


194 - Iqin,s0,tl,t2,...,t| Query Id Number 
To be defined and coded. 


197 - |qld,t| Query Left of Divider 

The value of this function is the (decimal base) number of 
positions - characters and partitions - located between the 
beginning of the "text” whose name is denoted by "t" and 
the current location of the internal "text divider" of said 
text. 


192 - Iqlll Query Line Length 

The value of this function is the current specification for 
the line length; this specification is changed through use 
of the "ell" function. 


134 - |qnb| Query Number Base 

The value of this function is the current value of the 
radix for arithmetic operations and functions. 


198 - Iqrd.tl Query Right of Divider 

The value of this function is the (decimal base) nun her of 
positions - characters and partitions - located between the 
beginning of the "text" whose name is denoted by "t" and 
the current location of the internal "text divider" of said 
text. 


204 - lqro| Query Rub Out char, schema 

The value of this function describes the current 
specification for the use of the "rub out"; see [cro]. 

205 - Iqtal Ouery Text Area used 

The value of this function is representative of the amount 
of space consumed in the text area by user defined texts. 


251 - Iqwc,a2,al,...,a| Query Warning Characters 

The value of this function is a list of the currently 
specified and functional warning characters of the 
language. 


262 - Iqwsl Query Work Space 
\qws\ 

The value of this function is the upper limit of the user 
work space; active form of this expression yields the value 
as a decimal number; neutral form yields the value in the 
current "X" base. 


201 - Iqxbl Query "X" Base 

The value of this function is the currently set radix for 
the functions which operate in a "binary" or "X" base. 


215 - Ira,d,sl,s2,s3,...,s| Return Argument 

The value of this function is that string symbolized by one 
of "si", "s2", "s3", ... "s" whose position corresponds to 
the value of the decimal number symbolized by "d". 


263 - |rcp,dl,d2,s| Return Character Picture 

To be coded. 


166 - |ri| Restart Initialized 

Execution of this function causes immediate termination of 
any unexecuted scripts, and causes return to the idling 
condition, reinitializing all normally changed user 
specifications. 


202 - Iqofl Query Over Flow conditions 

The value of this function are characters which may be used 
to identify the cause of an interrupt or overflow 
condition. 


167 - |qp,t| Query Partition 

The value of this function is the decimal identification of 
the next partition to be found in the text whose name is 
denoted by "t"; the text divider is not moved by this 
function. 


245 - Irj,s,sl,d,s2| Return Justified lines 

To be defined and coded. 

252 - |rn,n| Random Number 

The value of this function is a number ranging between 0 
and "n", randomly selected through a computational 
algorithm; see [srn]. 

189 - |rot,d,x| Rotate the bits 


267 - Igpc,s0,tl,t2,...,tl Query Protection Class 
To be defined and coded. 


me value of this function is that binary number which 
results from a rotation of the binary number "x" expressed 
ln current "X" base; the number of bits rotated is 
specified by the decimal number "d"; the direction is 


Page 30 


Dr. Dobb's Journal of Computer Calisthenics 8i Orthodontia, Box E, Menlo Park, CA 94025 


Number 21 


40 


Set Time 


clockwise if the number is positive, and counterclockwise 
if negative. 

247 - |rp,s,sl,d,s2| Return Padded lines 

To be defined and coded and coded. 


165 - |rr,sl| Return to Restart 

This function causes immediate cessation of execution of, 
any unexecuted script, forces a return to the idling level 
of the processor and then returns the value of the string 
symbolized by "si"; if that string is an executable 
expression, then said expression is executed. 

163 - |rs,s| Reverse String 

The value of this function is the string of characters 
symbolized by "s” reversed, end for end. 


228 - |saf,dev| Select All File function dev. 

To be defined. 


158 - |sari "Auto Return" on line feed 
\sar\ no Auto Return on line feed 

Execution of this function serves to enable (if active) or 
disable (if neutral) the automatic generation of a 
"carriager return" code when a "new line" code is output. 


260 - Isda,da,mo,yrI Set Date 

This function enables the user to set into the system the 
current ( r any other) desired date. 


258 - Isti,tl,t2,t3l 

Through use of this function the correct current (or 
incorrect if desired) time of day is established in the 
system. 


129 - Isu,nl,n2,...,n| Subtract 

The value of this function is the result of subtracting the 
number symbolized by "n2" from that symbolized by "nl"; all 
rules indicated for sign and non numeric matter in the "ad” 
function apply. 


231 - Isw,sl,s2,s3,...,s| Switches 

Special system dependent function for user definition. 


232 - |sy,sl,s2,...,sl System functions 

Special system dependent function for user definition. 


127 - |tb,t,vt,vf| Text Branch 

If the text whose name is denoted by "t" is to be found in 
the text area, then the value of the function is that 
string symbolized by "vt", else the value is string 
symbolized by "vf". 


257 - |ti,sl,s2| Time 

The value of this function is the current time of day 
derived from a system clock, in the format HH MM SS, where 
HH represent Hours, MM represent Minutes and SS seconds; 
these elements are separated in the value string by the 
string symbolized by "si". 


199 - |sem,dev| Set "Echoplex" Mode active 
\sem,dev\ "Echoplex" Mode inactive 

This function enables character echo from the system if 
executed actively; if neutrally, then echo generation is 
suppressed. 


222 - |sf,f,tl,t2,...,tl Store File 

This function is used to place into auxiliary storage under 
the file name denoted "f", those texts whose names are 
denoted by "tl", "t2", ... "t"; on completion of this 

action, the named texts are erased from the text area. 

If no texts are named, then the assumption is made that the 
entire text area is to be placed into auxiliary storage. 


157 - |sfd,fun,dev| Specify Function Device 

To be defined and coded. 

190 - |sh,d,x| Shift the bits 

The value of this function is that binary number string 
which results from a logical shift to the right or left of 
the string whose binary value, expressed in the current "X" 
base is symbolized by "x"; the number of shifts is 
specified by the decimal number "d" and the direction by 
its sign, positive to the right and negative to the left. 


125 - |tm,d| Trace Mode activated 
\tm\ Trace Mode deactivated 

This function is used to enable step by step execution of 
the scripts and functions of the language; once activated 
each step is initiated by depression of the "new line" key 
("line feed") or a specified number of steps may be 
specified by the number symbolized by "d". 


124 - Itmal 
\tma\ 


Trace Mode All activated 
Trace Mode All deactivated 


Active execution enables full trace action; neutral 
execution allows display only of expressions about to be 
executed. 


168 - |tr,t,s| 


Trim 


This function is used to replace multiple adjacent 
occurences of the character symbolized by "s" with a single 
such occurence in the text named "t". 


218 - |uf,f,tl,t2,...,tl Update File 

This function combines the action of "erase file" and 
"store file" by first storing a file successfully before 
erasing the old file version. 


253 - |srn,n| Seed Random Number 

Through use of this function the attomatic generation of 
random numbers is initiated; the user seed number is 
symbolized by "n" in the above expression. 


169 - |ut,ccl User Trap active 
\ut\ User Trap inactive 

Activating of this trap through use of this function will 
cause an automatic execution of a text (or function) whose 
name is denoted by "cc"; this automatic execution takes 


Number 21 


Dr. Dobb's Journal of Computer Calisthenics 8t Orthodontia, Box E, Menlo Park, CA 94025 


Page 31 


41 



place whenever the user attempts to make use of system 
interrupt capabilities to escape out of executing "scripts" 
when it is desired that such escape be inhibited. 

118 - Ivt,tl,t2,...,tI View Texts 

This function enables examination of defined texts, 
indicating visually the location of internal text divider, 
partitions and their values, as well as multipartitions. 


181 - |wc,sl,s| Write Characters 

Ibis plotter or display function generates a graphic 
display from a font of vectors named "si"; the string 
symbolized by "s" is the text string to be plotted or 
displayed. 

175 - lwi,xnl,ynl| Write Initialize 

This null valued function serves to create a reference 

value for the current position of the display pointer; the 
"x" and "y" coordinates of this position are set equal to 
the decimal integer strings found in the second and third 
arguments respectively. 

179 - |wl| Width Left 

The value of this function is the incremental value of the 
width of a character being plotted to the left of its 
center of gravity. 

178 - |wrl Width Right 

The value of this function is the incremental value of the 
width of a character being plotted to the right of its 
center of gravity. 

180 - |ws,xnl,ynl,_,xn,ynl Write Straight Lines 

This function causes the generation of the appropriate 
control information to cause the display of one or more 
line segments starting at the current position of the 
display pointer. Successive points are referenced by 
consecutive incremental x and y argument pairs. The x and y 
components are expressed as decimal integer strings. The 
sign of the number indicates direction. 

Non numeric matter preceding the "x" value causes certain 
auxiliary functions to take place as follows: 

U "pen up" or invisible vector 

S Scale change for "x" and "y" 

A Absolute position vector pair 

I Incremental vector pair 

0 Ouadrant rotation 

0-3 clockwise, 4-7 counter clockwise 
W Character width information 

"x" left and "y" right of center 

tr.-.-.—----- 

{) %dt,rect,(,8,0,0,5,-8,0,0,-5)/= 

{) %ws%rect//= 

U 


176 - |wx| Write "X" displacement 

The value of this function is equal to the alqebraic 
difference between the initial value "X" of the display 
pointer position and the sum of any subsequent incremental 
displacement values. 

177 - |wy| Write "Y" displacement 

The value of this function is equal to the algebraic 
difference between the initial value "Y" of the display 
pointer position and the sum of any subsequent incremental 
displacement values. 


An effective way to return the display pointer to its 
original location is illustrated as follows: 

TT.. 

{} %ws,U%wx/,%wy// 

{) 


Assuming it is desired to draw a rectangle,8 units wide, 
and 5 units high: 

170 - Ixc,xl,x2,...,x| "X" to Character 

The value of this function is a string of characters whose 
value is represented by the numbers in "X" base symbolized 
by "xl", "x2", ... "x". 


271 - |xcf,s,x| experimental Change Function 

This function is used to assign a user defined machine 
adress symbolized by the "X" base number "x" for the built 
in function whose mnemonic is denoted by "s". 

172 - |xd,x| "X" to Decimal 

The value of this function is the decimal equivalent of the 
number in the current value of the "X" base symbolized by 
"x". 


255 - Ixi,port I experimental Input 

The value of this function is that number in the current 
"X" base which results from an attempted input from the 
port whose designation in the "X" base is symbolized by 
"port". 


123 - |xj,x| experimental Jump 

Execution of this function cause a jump to the memory 
location symbolized in the "X" base by "x"; a return from 
programs encountered at that location will cause normal 
reentry into the system scanner. 


256 - |xo,x,port I experimental Output 

Execution of this function enable output of the "X" base 
value of "x" to the port whose "X" base id is symbolized by 
"port". 


270 - |xqf,s| experimental Query Function 

The value of this function is the machine adress in "X" 
base radix of the entry point for the function whose 
mnemonic is denoted by the string "s". 


119 - |xr,x| examine Register 

The value of this function is the contents of the memory 
location symbolized in the current "X" base by "x". 


121 - |xrp,x| examine Register Pair 

The value of this function is the combined contents of the 
two memory locations, whose first location is symbolized in 
the current "X" base by "x". 


120 - |xw,xl,x2| experimental Write in reg. 

Use of this function causes writing the value "xl" into the 
memory location "x2"; both of these are in the current "X" 
base. 


Page 32 Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 21 


42 






122 - |xwp,xl,x2| 


experimental Write reg. Pair 

Use of this function causes writing of the double word data 
symbolized in the "X" base by "xl" in the memory location 
whose first word is identified by "x2". 


126 - lyt,t,s,vt,vfI Ys There 

Ibis function searches the text whose name is denoted by 
"t" for an exact match with the string symbolized by "s“; 
if such a match is found, then the value of the expression 
is that string symbolized by "vt”, else it is that string 
symbolized by "vf". 


182 - |zd,r,v-,vO,v+| "Z" reg. Decrement and branch 

Execution of this function causes the contents of a special 
register identified by "r" to be decreased by a count of 
one.; if the resulting contents of that register are 
greater than zero, then the expression value is that string 
symbolized by "v+"; if egual to zero, then the value is 
symbolized by "vO", and if less than zero the value becomes 
the string symbolized by "v-". 


183 - Izi,r,v-,v0,v+| "Z" reg. Increment and branch 

The action of this function is identical to that described 
for "zd", except that the designated register "r" is 
increased by a count of one prior to testing. 


184 - |zq,r| "Z" reg. Query 

The value of this function is the current contents of the 
special register designated by "r"; execution of this 
function does not cause any change in said register. 


185 - lzs,r,n| "Z" reg. Set 

Ibis function is used to preset designated special register 
"r" to the number symbolized by "n". 


SAM 76 - Setting up the System 


Tl 
II 
11 


There are two versions available: II II 

11 Availability 11 


a. Z80 - little less than 8K 

Uses RSTO thru RST6 

b. 8080 - about 9 K 

Does not use any RST locations 

In addition the source code is available from a number of 
ACNJ members if special adressing reauirements are 
encountered or if it is desired to configurate a system 
with fewer functions, or different use of the PST 
locations. 

Except as indicated above both versions are virtually 
identical, and the information that follows applies to both 
of these versions; in consequence user defined texts and 
procedures may be successfully moved between systems using 
either of these two versions. 

Possible incompatibility may be ascertained through use of 
the SAM76 function which reveals the version number thus: 

tr.-. 

(} %P@n/=21 

{> 


reveals the version number of the "romable object code". 


a. Romable program loads at - 'h8000. 

b. "Once Only" start at “h8000 
initializes variables. 

c. Restarts may be made at 8003 or 0. 


2 

Memory 

utilization 


d. System and user variables start at ~h400 

e. Workspace is above ~h600. 


I/O specifications, and user options: II II 

11 System 11 

a. APPLE/ZAPPLE I/O Conventions apply. 11 Differences 11 

IJ_Li 

b. Normally initialized to seek and take 
available RAM. 

c. Special use of control codes is as follows: 

~C Return to Monitor 

*X Cancel current material typed in 

DEL Rubout (changeable by user) 

~N Shift Out to alternate character set 

“O Shift In back to regular character set. 


The Line Feed key is viewed by SAM76 as being equivalent to 
the "NULIN" code, as specified by ASCII; use of this key 
serves to go to the beginning of the next line - combining 
the functions of "Carriage Return and Line Feed". The 
Carriage Return serves only to return to the beginning of 
the same line; this permits underlining &c. 


Modifying SAM76 tables and options: 

There are two levels of modifications 
which the user may apply in the process 
of tailoring the SAM76 code to suit his 
system and needs: 

a. Permanent. 

b. Local or temporary. 

Ttie type of changes are identical but the location of the 
table to be changed and the time at which the table is to 
be changed are different. 

Effectively there is a main table of variables and options 
located in the "romable" or protected section of code; 
after having executed a "GO" to “h8000 this table is copied 
into the user work space starting at location "h40C. 

After this initial entry at "h8000 entry should be made 
only at "h8003 or at location 0 if the user wishes to 
preserve any changes made in the duplicate table at ~h40C 
either with monitor facilities or through the execution of 
SAM76 functions which are available to establish a variety 
of user options. 


4 

Fiddler's 

Guide 


Typical Permanent Changes: 

Normally changes in the table at “h800C 
should be limited to necessary 
respecification of I/O adresses, and in 
some special cases to the location of 
the beginning and or end of the user work 


5 

Useful 

Fiddles 


space. 


In addition the user may make permanent changes to such 
parameters as the maximum length of line, and the 
specification of the number of fill characters after each 
"carriage return/line feed". (Note Line Feed is the proper 
character used for this combined function). 


Number 21 


Dr. Dobb's Journal of Computer Calisthenics 8< Orthodontia, Box E, Menlo Park, CA 94025 


Page 33 


43 













Table 1 lists the primary portion of the table at "h800C 
with corresponding adresses of its duplicate at ”h40C. 

Table 2 lists locations that may be of interest to the user 
as candidates for permanent changes; since these locations 
may all be changed within the framework of the SAM76 
language, it is suggested that changes be made first in 
that manner, and that the modified duplicate table at "h40C 
be examined before making the desired changes in the 
permanent table. 


Caution should be exercised in changing 0P2 and TOPMAX so 
that TOPMAX be greater than 0R2 by at least “h400 bytes. 


I I 


TABLE 2 


(is continuation of TABLE 1) 



TABLE 1 


.SBTTL /Variables & once only code/ 
• PAGE 


;[VAR1] 
VAR1: 

• BLKB 

1 

[80/4-0C] 

JMP 

BOOT: 

. BLKW 

1 

[80/4-0D] 

Monitor Exit 

MSCI: 

.BLKB 

3 

[80/4-10] 

Console Input 

MSRI: 

.BLKB 

3 

[80/4-13] 

Channel 2 Input 

MSCO: 

■ BLKB 

3 

[80/4-16] 

Console Output 

MSPO: 

.BLKB 

3 

[80/4-19] 

Channel 2 Output 

MSLO: 

.BLKB 

3 

[80/4—1C] 

Channel 3 Output 

MSCSTS: 

• BLKB 

3 

[80/4—IF] 

Console Status 

MSCHK: 

.BLKB 

3 

[80/4-22] 

10 Check 

MSSET: 

.BLKB 

3 

[80/4-25] 

IO Set 

MSMCK: 

• BLKB 

3 

[80/4-28] 

Memory Check 

$232: 

• BLKB 

3 

[80/4-2B] 

%sy,xl,x2,.../ 

$231: 

• BLKB 

3 

[80/4-2E] 

%sw,x0,.../ 

. 

• BLKB 

3 

[80/4-31] 

spare 

OR2: 

.BLKW 

1 

[80/4-33] 

start active zone 

TOPMAX: 

.BLKW 

1 

[80/4-35] 

text area limit 

TOPLOC: 

• BLKW 

1 

[80/4-37] 

future3 

SPARE4: 

■ BLKW 

1 

[80/4-39] 

future4 


I 

Notes with reference to Table 1: 


a. The adresses indicated are those of the actual locations 
which would be changed as required to suit individual 
operating system requirements. 

b. If it is desired to disable any of the monitor functions 
which would be adressed via the vectors of Table 1, replace 
the JMP with a RET - (for instance one might wish to 
disable the automatic RAM grabber by putting a "RET" at 
"h8027" - If this is done it becomes necessary to actually 
stipulate the adress of the end of user workspace by 
entering said adress at ~h8037). 

c. $232, and $231 are locations of jump vectors for the 
SAM76 functions "sy" and "sw" respectively. These are 
intended for user applications; if not required it is wise 
to change the adresses for these functions at “h802B and 
*h802E respectively to the adress found at "h8031 - this 
causes the message <nav-xxx> to be returned should these 
two functions be tested. 

d. Location labelled "TOPMAX" is usually shown as 00-00; 
this in combination with the availability of the MEMCHECK 
function of the ZAPPLE monitor triggers the automatic 
determination of the upper limit of user work space. A non 
zero value at that location takes precedence and serves to 
restrict the user work space to that specified. 

e. Location labelled "OP2" defines the beginning of the 
user work space; this may be changed if the user wishes to 
have clear space for his own purposes at it's normally 
initialized value of 05FE. 


TIR: 

.BLKW 

1 

; 0 

TO: 

• BLKW 

1 

; TCO 

TI: 

• BLKW 

1 

; TCI 

TT: 

• BLKW 

1 

; TCT 

TR: 

■ BLKW 

1 

; TCR 

TE: 

.BLKW 

1 

; Till 

RIX: 

• BLKB 

1 

; N12 

BIX: 

.BLKB 

1 

; N10 

MCH: 

.BLKB 

1 

; "=" EQUAL 

TCE: 

• BLKW 

1 

; FNP1 

CE: 

.BLKW 

1 

; SCE 

TO2: 

• BLKW 

1 

; o 

TC3: 

• BLKW 

1 

; o 

TCECT: 

.BLKW 

1 

; 0 

TCEAN: 

■ BLKB 

1 

; 0 

ROBOT: 

.BLKB 

1 

; N177 

RUBOl: 

.BLKB 

1 

; N74 

RUB02: 

• BLKB 

1 

; N76 

NULCH: 

• BLKB 

1; 

null charact 

NULCT: 

.BLKB 

1; 

filler count 

PLIN: 

.BLKB 

1; 

line length 


Notes regarding changes in Table 2: 

a. PLIN contains the number of characters on a ling at 
which SAM76 is required to automatically generate a 
"NULINE" on the console device. This is usually initialized 
in the permanent table at 72 decimal (“h48), and is changed 
in the duplicate table by using the "ell - Change Line 
Length" function thus: 

TT. 

(} %cll,64/= 

U 


would set line length at decimal 64; the permanent table 
may be changed prior to being placed into protected memory 
using the neutral form of this function. 

b. NULCT, and NULCH locations are used to specify the 
number and the type of "null" character the user wishes to 
have automatically generated on the console device when a 
"NULIN" is output to it. This is usually initialized at 
zero count, and ASCII-0 for the character; to change this 
requires the use of the "cfc - Change Fill Character" 
function thus: 

TT.. 

{} %cfc,*,4/= 

U 


puts 4 asterisks at beginning of each new line; the neutral 
form of the function is used to change the permanent table. 

c. ROBOT, RUBOl, and RUB02 are used to specify the 
character to be used for character deletion purposes, and 
the symbols that are desired to surround the string of 
consecutively deleted characters; initially this is set to 
be the ASCII - DEL code and the surrounding symbols are the 
< and > brackets. Changing this makes use of the "cro - 
Change Rub Out" function thus: 

TT . 

{} %cro,$AB/= 

{} 


Page 34 


Dr. Dobb's Journal of Computer Calisthenics 8i Orthodontia, Box E, Menlo Park, CA 94025 


Number 21 


44 












sets $ to be the deleting character and the deleted string 
is bracketed by A and B; the neutral form of this function 
may be used to change the permanent table. 

d. MCH is the location of the character used to terminate 
entry; this character is known as the "Activator". 
Initially this is set to be the = sign, and is changed via 
use of the "ca - Change Activator" function thus: 


e. Three types of anomalies are flagged by output to the 
console: 


T Time out no tape or jammed tape 

M Memory error 

P Parity error in block 


TT.. 

ft ica,Z/= 

U 


changes activator to be "Z"; use the neutral form to change 
the permanent table. 

e. RIX and BIX are the current specifications for the 
arithmetic and logical or binary bases respectively. These 
locations are initialized to provide base 10 for arithmetic 
and base 16 or hex for logical functions. Within the 
framework of SAM76 they are changed using the "cnb - Change 
Number Base" and "cxb - Change X Base" functions; for 
example: 


f. For the afficionado format is described below: 

16 Bytes “h80 or "o200 

SOH "hi 

DEL “hFF or “o377 

1 byte Number of data bytes (0 means 256) 

2 bytes Load adress (Low then High) 

variable data bytes 

2 bytes Check Sum 


ii-ri 

I I LOADIT - loader 11 


TT.. 

{} %cnb,7/= 

U 


sets arithmetic base to be 7. 

tr.—. 

{} %cxb,8/= 

{} 


sets logical or binary base to octal. 

The neutral form of these functions may be used to change 
the permanent initialization table. 


SAM76 - Loading the object code tape 



The two versions are available in compressed binary form 
for which a special loader is required; this loader is 
usually to be found in normal hex loader format ahead of 
the binary. 

The normal procedure to load is as follows: 

a. Load the hex formatted loader; 

b. Ttie loader should be at “hlOOO to “h475; simply go to 
“hlOOO if using APPLE/ZAPPLE monitors, otherwise change the 
calls to F006 to reflect your own reader input routine 
before running. 

c. If using APPLE/ZAPPLE just do a G8000 to start SAM76, 
otherwise make the appropriate changes as required with 
reference to Table 1 first. 

If you are using a machine with output lights at port FF, 
then the progress of loading will be displayed. As each 
block is successfully loaded a check sum will appear for a 
few seconds then the adress of the new block being loaded 
will be displayed. If the check sum remains, an error is 
indicated and then it is necessary to stop the reader, back 
up the tape to the beginning of the previous block, start 
the reader and G400 again. 

d. Test SAM76 by getting a list of available built in 
functions by typing in the following: 

&@@f, /= 


-RADIX 8 ; added by editor 


.TITLE /loadit/ 

.IOC 002000 ; “hl000 

ZAPMON= 1 

ZAPPLE= 170000 ; *hF000 

SENSE= 377 ; “hFF 

;Control Codes 


OCDLE= 

20 

Data Link Escape 

CCENQ= 

5 

Enquiry 

CCEM= 

31 

End Message 

CCSOH= 

1 

Start of Header 

CCETB= 

27 

End of Tx Block 

CCACK= 

6 

Acknowledge 

CCNAK= 

25 

Neg. Acknowledge 

CCSTX= 

2 

Start Text 


•DEFINE SKIP2[R] = 


(.BYTE 

001I[[[R]&6]<31 

GETLDR: CALL 

GETBY 

CPI 

CCSOH 

JZ 

SOHFND 

GETLDX: CPI 

CCETB 

JZ 

RSEXIT 

CPI 

170 

JNZ 

GETLDR 

CALL 

GETAD 

PCHL 

;all done 

SOHFND: CALL 

GETBY 

CPI 

377 

JNZ 

GETLDX 

LDR377: CALL 

GETBY 

MOV 

C,A 

MVI 

E,0 

MOV 

D,E 

CALL 

GETAD 

LOAD: CALL 

GETBY 

RCVOK: MOV 

M,A 

MOV 

B,M 

CMP 

B 

JNZ 

MEMERP 

I NX 

H 

DCR 

C 

JNZ 

LOAD 


Number 21 


Dr. Dobb's Journal of Computer Calisthenics 8< Orthodontia, Box E, Menlo Park, CA 94025 


Page 35 


45 










CALL 


PARTST 


JMP CETLDR 


NIXNIX: MVI 

C,"?" 

SKIP2 

D 

MEMERR: MVI 

C,"M" 

SKIP2 

D 

PARERR: MVI 

C,"P" 

SKIP2 

D 

TIMERR: MVI 

C,"T" 

EREXIT: CALL 

CO 

RSEXIT: JMP 

RESTART 

GETAD: CALL 

GETBY 

MOV 

L,A 

CALL 

GETBY 

MOV 

CMA 

H,A 

OUT 

RET 

SENSE 

GETBY: CALL 

RI 

JC 

TIMERR 

PUSH 

PSW 

ADD 

E 

MOV 

E,A 

JNC 

GETBYR 

INR 

D 

GETBYR: POP 

RET 

PSW 

PARTST; POSH 

D 

CALL 

GETAD 

POP 

D 

MOV 

A,H 

CMP 

RNZ 

D 

MOV 

A,L 

CMP 

RET 

'E 


•END ;Pseudo op added by editor 



Quick Reference Information for the [j 
SAM 76 Language_ jj 


II I I An attempt was made, in the selection of 

I| Mnemonics I I the mnemonics of the resident functions, 

|J_[| to be consistent in the use and meaning 

of words or terms represented by the 
function names; generally, whenever reasonable, letters 
used in the function names may be expanded as follows: 


letter 

position 1 

positions 

2 and/or 3 

a 

alphabetic 

all 

activator 

b 

bring 

branch 

base 

c 

change 

character 

c3 

d 

define 

decimal 

divider 

e 

erase 

element 

e3 

f 

fetch 

file 

field, function 

g 

gi 

greater 

g3 

h 

how many 

h2 

h3 

i 

input, if 

identical 

initialize 

j 

jl 

jump 

j3 

k 

kl 

k2 

k3 

1 

list 

left 

length 

m 

ml 

match 

mode 

n 

neutral 

number 

n3 

0 

output 

o2 

o3 

P 

partition 

P2 

P3 

q 

query 

g2 

q3 

r 

return 

right 

register 

s 

set, select 

string 

space 

t 

trace 

text 

t3 

u 

update, user 

u2 

u3 

V 

view 

v2 

v3 

w 

write 

warning 

work 

X 

experimental 

"X" number 

base x3 

y 

yi 

y2 

y3 

z 

Zpecial 

z2 

z3 


In the above table only the more frequently or major terms 
are indicated; positions marked with a letter number pair 
are for possible reference. 

It should be noted that the meaning of the words used in 
the above table are consistent; that is to say that the 
same connotation may be applied - for instance "text" 
always means; "a named string of symbols to be found in the 
text area". 


11 Quick reference 

1 1 

resident function list 11 

II 

238 - I@f,sO1 

wh@ are Functions 

239 - l@n| 

wh@ is processor ser. Number 

237 - |@t| 

wh@ is processor Title 

159 - Iab,sl,s2,vt,vf1 

Alphabetic Branch 

128 - Iad,nl,n2,n3,...,n| 

Add 

160 - Iai,s0,sl,s2,...,s| 

Alphabetic Insertion 

187 - |and,xl,x2| 

And the bits 

161 - Ias,s0,sl,s2,...,s| 

Alphabetic Sort 

220 - |bf,f,vz| 

Bring File 

113 - |ca,s| 

Change Activator (current) 

\ca,s\ 

Change Activator (initial) 

195 - |cfc,dl,sl 

Change Fill Character schema 

\cfc,dl,s\ 

Change Fill Char, (initial) 

193 - lcin,tl,dl,...,t,d| 

Change Id Number 

148 - |cld,tl 

Characters Left of Divider 

191 - |ell,d| 

Change Line Length (active) 

\cll,d\ 

Change Line Length (initial) 

133 - |cnb,d| 

Change Number Base (active) 

\cnb,d\ 

Change Number Base (initial) 


Page 36 Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 21 


46 


266 - lcpc,tl,dl,...,t,d| 

Change Protection Class 

147 - |crd,tI 

Characters Right of Divider 

203 - |cro,sll 

Change Rub Out char, schema 

\cro,sl\ 

Change Rub Out (initial) 

132 - Ict,tl,t2,t3,...,t| 

Combine Texts (superseding) 

\ct,tl,t2,t3,...,t\ 

Combine Texts (save current) 

250 - lcwc,sl| 

Change Warning Character 

\cwc, ... \ 

Change Warn. Char, (initial) 

261 - |cws,d| 

Change Work Space 

\cws,x\ 


171 - |cx,sO,s| 

Character to "X" 

200 - |cxb,d| 

Change "X" Base (active) 

\cxb,d\ 

Change "X" Base (initial) 

259 - Ida,s0| 

Date 

131 - |di ( nl,n2,vz| 

Divide 

208 - ldq,sl 

Define Quote 

- |dr,t,a,o,vl 

Define Relationship 

164 - |ds,d,s| 

Duplicate String 

103 - |dt,t,s,dl,d2| 

Define Text (superseding) 

\dt,t,s,dl,d2\ 

Define Text (save current) 

173 - |dx,d,x| 

Decimal to "X" 

206 - Iea,tl,t2,...,tl 

Erase fill excepting 

207 - |ed,t,dl,d2,vz| 

Extract "D" characters 

224 - |ef,fl,f2,...,f1 

Erase Files 

151 - |ep,t,pl,p2,...,p| 

Erase Partitions 

- ler, ... I 

Express Relationship 

104 - Iet,tl,t2,...,t| 

Erase Text 

\et,tl,t2.t\ 

Erase all occurences of Text 

249 - letb.sl 

Erase Trailing Blanks 

112 - |ex,f| 

Exit 

226 - |fb,f,vt,vfl 

File Branch 

137 - |fc,t,vz| 

Fetch Character 

138 - |fdc,t,d,vz| 

Fetch "D" Characters 

139 - |fde,t,d,vz| 

Fetch "D" Elements 

140 - |fdm,t,d,s,vz| 

Fetch "D" Matches 

141 - |fe,t,vz| 

Fetch Element 

142 - jff,t,d,vz| 

Fetch Field 

143 - |fl,t,s,vz| 

Fetch Left match 

145 - |fp,t,xl,...,x| 

Fetch Partition 

144 - |fr,t,s,vz| 

Fetch Right match 

106 - |ft,t,sl,s2,...,s| 

Fetch Text 

210 - |ftb,t,s,vzl 

Fetch To Break character 

211 - |fts,t,s,vz| 

Fetch To Span character 

212 - |hc,s| 

How many Characters 

150 - |hm,t,s| 

How many Matches 

149 - |hp,t,d| 

How many Partitions 

114 - |ht,t| 

Hide Text 

\ht\ 

Hide all Texts 

115 - licl 

Input Character 

116 - lid.dl 

Input "D" characters 

153 - lidt.dl 

Input "D” Texts 

136 - 1 ig,dl,d2,vt,vfI 

If Greater 

135 - 1ii,sl,s2,vt,vfI 

If Identical 

117 - Iim,sl,s2,...,s| 

Input to Match 

102 - I is,dev I 

Input String 

152 - |itl 

Input Text 

213 - |iw,n| 

Input Wait 

- lief,devI 

Load External Function 

216 - |If,s0,dl.d| 

List Files 

- Ur, ... I 

List Relationship 

105 - |lt,s0,dl,d2,...,d| 

List Texts 

110 - jmc,d| 

Multi-partition Character 

146 - |md,t,d| 

Move Divider to pos. "d" 

\md,t,d\ 

Move Divider "d" increments 

109 - |mt,t,sl,s2,...,s| 

Multi-part Text all matches 

\mt,t,sl,s2,...,s\ 

Multi-part Text next match 

130 - |mu,nl,n2,vz| 

Multiply 

111 - |ni,vt,vf| 

Neutral Implied 

188 - |not,xl 

Not (complement) the bits 

209 - |nu,sl,s2,...,s| 

Null 

246 - |oj,s,sl,d,s2| 

Output Justified lines 

248 - |op,s,sl,d,s2| 

Output Paddded lines 

186 - |or,xl,x2| 

Or the bits 

101 - |os,s| 

Output String 

154 - |ot,tl,t2,—,t| 

Output Texts 

108 - lpc,d| 

Partition Character 

174 - Ipl,sl,s2,...,s| 

Plot 

162 - |ps,d,sl,s2| 

Pad String 

107 - Ipt,t,sl,s2,...,sl 

Partition Text all matches 

\pt,t,sl,s2,...,s\ 

Partition Text next match 

196 - Iqfc.sOI 

Query Fill Character schema 


194 - Iain,s0,tl,t2,...,tl 

Query Id Number 

197 - Iqld.tl 

Query Left of Divider 

192 - Iqlll 

Query Line Length 

134 - jqnb| 

Query Number Base 

202 - laofl 

Query Over Flow conditions 

167 - |ap,t1 

Query Partition 

267 - Iapc,s0,tl,t2,...,t| 

Query Protection Class 

198 - |qrd,t| 

Query Right of Divider 

204 - Igroj 

Query Rub Out char, schema 

205 - Iqtal 

Query Text Area used 

251 - |qwc,a2,al,...,al 

Query Warning Characters 

262 - Iqwsl 

Query Work Space 

\aws\ 


201 - Iqxbl 

Ouery "X" Base 

215- Ira,d,sl,s2,s3,...,s| 

Return Argument 

263 - Ircp,dl,d2,s| 

Return Character Picture 

166 - | r i | 

Restart Initialized 

245 - |rj,s,sl,d,s2| 

Return Justified lines 

252 - |rn,n| 

Random Number 

189 - |rot,d,x| 

Rotate the bits 

247 - Irp,s,sl,d,s2| 

Return Padded lines 

165 - |rr,sl| 

Return to Restart 

163 - |rs,s| 

Reverse String 

228 - |saf,dev| 

Select All File function dev. 

158 - Isarl 

"Auto Return" on line feed 

\sar\ 

no Auto Return on line feed 

260 - lsda,da,mo,yrl 

Set Date 

199 - |sem,dev| 

Set "Echoplex" Mode active 

\sem,dev\ 

"Echoplex" Mode inactive 

222 - Isf,f,tl,t2,...,tl 

Store File 

157 - |sfd,fun,devl 

Specify Function Device 

190 - |sh,d,x| 

Shift the bits 

253 - |srn,n| 

Seed Random Number 

258 - |sti,tl,t2,t3| 

Set Time 

129 - |su,nl,n2,...,n| 

Subtract 

231 - Isw,sl,s2,s3,...,s| 

Switches 

232 - |sy,sl,s2,...,s| 

System functions 

127 - |tb,t,vt,vf| 

Text Branch 

257 - |ti,sl,s2l 

Time 

125 - Itm.dl 

Trace Mode activated 

\tm\ 

Trace Mode deactivated 

124 - Itmal 

Trace Mode All activated 

\tma\ 

Trace Mode All deactivated 

168 - |tr,t,s| 

Trim 

218 - |uf,f,tl,t2,...,tl 

Update File 

169 - |ut,cc| 

User Trap active 

\ut\ 

User Trap inactive 

118 - Ivt,tl,t2,...,tl 

View Texts 

181 - |wc,sl,s| 

Write Characters 

175 - |wi,xnl,ynl| 

Write Initialize 

179 - |wl| 

Width Left 

178 - Iwr| 

Width Right 

180 - |ws,xnl,ynl,...,xn,yn| 

Write Straight Lines 

176 - |wx| 

Write "X" displacement 

177 - |wy| 

write "Y" displacement 

170 - 1xc,xl,x2,...,x| 

"X" to Character 

271 - |xcf,s,x| 

experimental Change Function 

172 - |xd,x| 

"X" to Decimal 

255 - 1xi,port I 

experimental Input 

123 - 1xj,xI 

experimental Jump 

256 - |xo,x,port| 

experimental Output 

270 - |xqf,s| 

experimental Query Function 

119 - |xr,x| 

examine Register 

121 - |xrp,x| 

examine Register Pair 

120 - |xw,xl,x2| 

experimental Write in reg. 

122 - |xwp,xl,x2| 

experimental write reg. Pair 

126 - |yt,t,s,vt,vf| 

Ys There 

182 - |zd,r,v-,v0,v+| 

"Z" reg. Decrement and branch 

183 - |zi,r,v-,v0,v+| 

"Z" reg. Increment and branch 

184 - lzq,r| 

"Z" reg. Query 

185 - |zs,r,n| 

"Z" reg. Set 


Editorial Note: Object tapes for the 8080 and Z-80 versions of 
SAM 76 are available from Computer Mart of New Jersey, 
501 Rt. 27, Iselin, NJ 08830. Telephone: (201) 283-0600. 
Tentative price will be $6.00. Computer Mart of New Jersey 
will also be publishing a book containing all available docu¬ 
mentation on SAM 76. Available in early Spring, it will sell 
for $9.95. -TRW 


Number 21 Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 Page 37 


47 





An 8080 Disassembler and 
Support Software for SOL 


by Don Van Dyke 
1125 Lakehurst Rd. 

Livermore, CA 94550 

This is a guide for the use of the following disassembler. 
This disassembler performs most of the work of creating a file, 
but may require human help in the case of lookup tables. 

Requirements 

1. 4k of ram in the area from D000 to E000 (hex in the same 
area of ALS8 requires its scratchpad. 

2. ALS8 assembler with TXT-2 addition. The user must there¬ 
fore also have a VDM-1 or SOL video display. 

3. Enough ram to contain the disassembler, (2k) the created 
file, the object code and the ALS8 assembler, though oper¬ 
ation of this program does not require that ALS8 be in 
memory at the same time if the return point is modified. 

4. SOLOS or CUTER. This program calls the standard input 
routine and inputs from the current pseudo port. 

Instructions 

1. Load the object code to be disassembled into the portion of 
memory where it normally resides. 

2. Choose the correct version of the disassembler. Pick one 
that is located out of the way of the object code, and leave 
enough room for the ALS8 file. Remember that lk of 
object will usually create about Ilk of source. Load the 
program into memory. 

3. Execute the program at the proper location, depending on 
the version selected from the tape. Instructions will be dis¬ 
played on the screen. 

4. After a few seconds the disassembly will be completed, at 
which time it will jump to E060 (the standard ALS8 return 
point), and will display the message “READY”. 

5. Create a new file with the command: 

FILE /name/ location 

and perform an FCHK on it. You should then be able to 
list, edit, or assemble the file at any location by using the 
proper ALS8 commands. 

Helpful Hints 

1. In some cases, it may be necessary for the user to decide 
where data tables are located in the object program. Meth¬ 
ods for determining where these tables are located are 
provided in the program: 

a. The ASCII equivalent for each operation is provided in 
the comment field, if it is a letter, number, or punctua¬ 
tion symbol. This provides easy location of key words 
in tables, and the user should exercise caution when 
changing these areas. 

b. Whenever the file contains a line such as: 

0025 LC03BH DB OCBH 

this means the op found at that location contained an 
unused 8080 instruction, and is therefore part of a table 
of some kind. 


2. If the file contains any undefined symbol errors during 
assembly, this means a label is required in a table, where a 
two or three byte operation overlapped the op where the 
label was to be placed. This situation must be resolved by 
the user by the following method: 

a. Assemble the file, noting any undefined labels and write 
the labels down on paper. 

b. Use the TXT-2 video editor to add an ‘EQU’ pseudo 
statement immediately preceding the statement that 
required the label. An example is shown below. 

Suppose the disassembler creates a file as follows: 


0001 L0104FH 

LXI 

H, L029FH 

0002 

MOV 

A, M 

0003 

INX 

H 

- (etc.) 



0455 

LXI 

B, 04567H 


.... (etc.) 

Then during assembly, this is generated: 

017F21 00 00 U 0455 L0104FH LXI H, L029FH 

(the ‘U’ denotes and undefined symbol) 

Where L029FH should be on the SECOND BYTE of the 
statement: 

0455 LXI B, 04567H 

The user should add the following line to the file: 

»> 0000 L029FH EQU $ + 1 «< 

0455 LXI B, 04567H 

Note that this will assemble into the same thing, but will 
allow the use of the label. 

3. Notice that the line numbers generated are all 0000. This is 
not a problem since the RNUM function may be used to 
renumber the lines. Be sure to do this before using the line 
editor, but it is not required for the video editor. 

4. To insure compatability with assemblers, this program 
generates a ‘6’, instead of SP, PSW, or M. Also, three byte 
instructions contain the address in normal order, rather 
than the reverse INTOL standard. 

5. Since PCHL instructions can be hazardous in the case of 
modifying H&L, this program generates a warning when it 
encounters a PCHL op. The following message will appear in 
the comment field: 

******* <<<; WA rn IN G »>*♦***** 

Support Software 

This is a guide for the use of the support software for the 

accompanying disassembler. 

Requirements 

1. ALS8 assembler with TXT-2 addition. The user must 
therefore also have a VDM-1 or SOL video display. 


Page 38 


Dr. Dobb's Journal of Computer Calisthenics 8< Orthodontia, Box E, Menlo Park, CA 94025 


Number 21 



2. 12k of ram from D000 to FFFF (hex) (the standard ALS8 
configuration). 

3. SOLOS or CUTER. This program calls the standard input 
routine and inputs from the current pseudo port. 

Debug 

1. This program uses the current file pointers from ALS8 
and will help to restore crashed files. Although it cannot 
work miracles, in most instances it will restore the file 
to a point where the video editor can finish the job if 
necessary. 

2. It is recommended that DEBUG be loaded into memory 
and be made an ALS8 custom command - i.e.: 

CUSTE / DBUG /CBOO then when the file needs to be 
fixed, make it the current file using: FILE /name/ <cr>. 
Then type ‘DBUG’. After a few moments, ALS8 should 
respond with an FCHK and a ‘READY’. 

Adump 

1. This program works in conjunction with SOLOS or CUTER 
and will display the contents of memory in its ASCII 
equivalent. 


2. To use the program, load it into memory from the tape, 
then make it a custom command by typing: 

>CUST AD CBOO 

The program will now operate like a standard dump by 
typing this command: 

>AD (beginning address) (end address) 

Note that only characters inside the range from 10 to 7E 
(hex) will appear on the screen, and anything outside that 
range shows up as a 

Exam 

1. This program allows the user to examine the contents of 
memory, and is very useful in locating tables and text in 
memory when used in conjunction with ADUMP. 

2. To use this program, load it into memory and execute it at 
the beginning. What you will see is the first lk of memory. 
To advance to the next lk segment, press the up arrow 
(or ctrl-W), to back up to the previous lk segment, press 
the down arrow (or ctrl-Z). To advance 8k at once, press 
tab (or Ctrl-I). To exit to SOLOS or CUTER, press escape. 

ALS8, TXT-2, VDM-1, CUTS, SOL, SOLOS and CUTER are 
copyright by Processor Technology Corporation. 




"O a in in in o o w in o if) 10 o©inin©ooinio© in in . © © in o 

auooo o o o o © © © ©o © o© © ©o c© © o |© © © o 

ii.o<r<rn uj o) <r o <i « n <t ilun « thoaotc <tu n <i . m m m 

u.onnio ituco^trnisrt m o a a m m o* o m r i in m m n mm |rs rv m co 

t-. rj ^ n u. m m a -- th <r a <x > cs r< m u lu <t a m < ck ci a uj n 'Oa •> c-j m in m <£ a <i m ml a n m a a a a ri m a r i O' a rv rv rv rv is 

m n n ri ck a a u o h n u n c o w u u h n o n u l u n u n o ri u a u m uj m m rr cj ^ ci c-i rj u h h w n u o u u o © o o t 

ooooooooooooooooooon'Oi>'UiiOMTN<tQOi , i'(iMiiaiuau.f'in'0!Miijora)N«Hiijrt<r<r<r?tfoi)'4-ij|ii.i'in^ii)'CN«itiuaortNnM'OMii)'« 
o o o o o o © o o o © o o o o o o o © © © o o o ^ ^ ^ ^ c-i c-i n ri c-i ri n ri ci m m m m m m >r *t si - ) tiT li - ) m n n u " iit li - ) l"! u") >o c >o >c >c -c >c -o -o -c rv rs ps iv rs ?s n rs 

0000 ©© 0000000 © 00000 © 000000 © 0 © 0000 ©© 000 © 0 © 0 © 00 ©© 00 ©© 00©©©0000 0 0 000 ©© 000 © 00000000 © 0©00 
©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©ooooooo©©©©©©©©©©©©©©©©©©©©©©©©© 1 ©©©©©©©©©©©©©©©©©©©©© 


Number 21 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 39 


49 


ut 


wCi 

<r 



<r <r - 
* t- c 

*x 

u. a i 


in <r 
UJ 

_i in 

a, X 
r u 

m 2 
in 3 
<r 2 


u u o 
c c o 

3 _l _l _l 

: c z in in 

: JOOQ 


£ 2EU 
cuujrori 
2 u I 2 . 


J <X t- <C u. 2 X £ L 


<1 12 3 UJ ~ h- UJ 

ct: o in 

3 3 (- O ~ ►— UJ 


C 2 in _l 13 u 


in O U Cl 

UJ -J 0 3 

_i m 2 _j 2 

- fc LL O 


. <r o _j 3 co th 


3 Cl U 3 C 
3 2 M 2 3 1 
2 IJ 3 CC 2 l 


-J_]-J_J_IX_l_i UJHXHU. J3<r i<lH L-( LH l-H 
IX3XI3 2<r^i2I3232T3i-2i=iCLNLLMu.NCLNCLN 
Jtn_injXJUT!-2HE-!j£0T)JU£C(J£CUfl'U£CUfll 


■ ***** i 


o — 

rx 'v 


CM 

rx 


rn 

rx 


•o md o- o -• n « <r p < md &• c h n n ? n ; -o n 
rsrvrv'^cccooococDCOooDoocoo-CN^n-Ch omO* o- 


o c o c 


oooooooooo 


ccooocooooocc 


cocso-*r4'r«rijT'OrscoO'C*^rjfn«?ii-5'C'vcoc>-o — C4fn«riiT'Crso3CKO-*rjm^-i,T'Orvooi>*o^cim«rm'Orvooi>o^rgM<- 

o-occocccocoo — -'- 1 '— •—. h « n n n r< n n n r-j ri fi w n n n w m m n to to v ^ <r «r <r v c t <r ’nn in in in n 

^ h n f; r; rj cm cm cm ri cm cm c. cm c« cm r; -< cm r. m cm cj cm cj (\ a c; ci cm r-j *. cm n cm ci cm cm cm cm m cm cm cm cm cm cm cm cm cm cm cm cm cm 
ooocooooooooooccccoococoooooooccoocooocoooooooocoocoooooo 


UJ -- UI fx CM UC’UJmUJ'CO* •0 0' 
CM O Cl U U CJ U CM U r. o cm IJ CM 

<ruj<i'0uj<EUj<iuj*3:Lj<ruj«ic 
Uli.UlHLUa.UL.UL 

CM If) fx C(JUJ-Mf*3'03i£ 

O O O O O O -H • 


*n <x|ci n n <t ci n k, c n n ci <i « 

-h'O O -H C — O CM CM CM CJ CM U 


ufl<ICU<II> 
N a U C N 4 u 


ooooc ocooo 


ON’TOO 
m «r m *r <r 


'OliKIflN- 
m >c rs «t o 


o o 
o o o 


o c 

«T O 


ULUHU — -HU -H->'0-H0-H0 — 0 CM rM CM CJ CM U NaUuNSU CM CM CM CM Cl UJ CJ U U Q Cl M Cl M U CM NO U H 

u c cm mj o- cx <i cc ui iij uj ui Lj ulc -h r< m«r m •c'xciiiuu ciin in in in *crNC*cjQuujujujLJUj w ■— Mrrx<rciLj»-MMrfxc3uo cm in oc^uu 

-* cm cm cm cm cm cm cm cm Cm cj cm cm cm CM.m momm .'■:mfnnm'nfo«r'<r*rHr«rc-*r«r'rT«T'<rHr<r«r«T*T<ri,TLTiiTL‘!u~i")'<5'C'0'0'C'orvfN.rvrvrsrsrv 

ooooooeooocooooooooooooooo'o oooocoocoooooocooocoococoooooooooooooooococoooco 


’H —H CM 

<rcj<rcM<r*«ii=i<rcj<:*on'<im<rujCMm<rujcoujauicouooujcD 

CM CJ CJ Cl CM UJ CJ U U Q CJ n n M U Cl Ml U rt u. U II U 1 l U It u u. u 
■cuiHTNcou.o cm b) m > u u. o cm win'COO'Oiuui 

i.i i^ .n i-. rv tv tv fvfvfvCDCcjDcaoOCDfflCDCOQO 

ooooooooooo 


Cl 2 
2 UJ 
O CC 
U uC 


12 3 

in > 


CC <E 
<r in 
X Wi 

u u 


O Cm 

iXi O 

2 2 3 
O >- 

•-mu 


- cc 3 

J U 3 

3 in c 


U 2 H LO »■ 

UI UJ h- UJ 3 

12 CC in >- 2 


2 I X 
► c <r 
« M O 


X _| 3 •- 3 •- »-« H|- 

2<IuUJQ3iU3LJ 

•-ucccxmoccincc 


x o 2 in 

• * M J U 

: x <r o a. >- 


->X3»-*N‘- 
> 2 3 U 2 UJ 
>2UTCC 


in u 

) UJ MX 

: >- cc 


> o i cn i o ' 

• U2 Q LL i2 
: O •- O >- fx <X 3 


CC Ml 
3 - 

: u 2 : 


C u. 3 ) 
J 2 O 3 
) “) 2 *■ 


2 0 XU 


in uj 

> J- 
<1 2 


‘XXC 
3 Ui UJ 3 
2 2 2 <X 


3 0>-23X2mT 


lh O 
U MX 
3 in 
o cn 

CC UJ 
2 

in 


Cl CD 

2 in 

3 _! 


in in 
in uj 
< r cc 


M UI 3 

i 2 2 


- O •— Cl Ui ll 

i _! 222 X X IXXX 3 fi 

> 2 •- 3 0 c c m cm a ci a i ro i x z x z : 

■ o l z a o c at-ahu.ZLZ'jHrjH. 

iaoLcauSoaoaoHONriucMLr 


a x x 
: 2 u o 

M "H 3 U 

) u c c 


H JH JIJ J < 

XXXXUIMTNUC 

jkjjxjuti. 


<x * * * a c 

unsjrscoo'O-* cm mMTui^rv 
to O IS CO CO O- CJ> O' »■ CK tMJ- > 
ooooooooooooo 
ooooooooooooo 




* * * * 2 


2*»****u 


ooooooooooooo 


- CM N <f n M3 

o o o o o o 


O' o 
-H CM 

o o 


oooooooooiooooooocoooooooooooooooooooocooooocooooo 


a u. c a u 


nSOS>USjUiCD'Oi> 

n cj co cj r — • — - 

co CJ u. o - 
rv tv ix m 
o o o o 
o o o o 


3 3 0 3 3 
o o o o o 
ocooo 


a- <i <i i <1 a u. 

3 3 3 3 3 3 3 

c o o o o o o 

o o o c o o o 


n iv x x r. 0 u l -m rj ^ m> c m ui it h n ri n ri ri M 1 n <0 ms > u u u u u u u u L ri t* x 0- u k n ii) co a w o f i \ c u l. -i •? mi &• a . : d 
i^irt«iiii?!^i^SJSJ <:<I,I<I *' SfifiiIlSi ®l JS * i '' IiIi ** ilii:il5ifiiSiS * u uuuuuaaaaDaLLLLiJLLLUULLuo 

ooooooooovjtoooooov^ooooooooooooloooooooooooooooocoooooooooooooooooooooo-* 
^mxoOvmOO^OCOOOOOOCOOOOOOOOO. oooooooooooooooooooooooooooocooooooooooo 


ooooooooooocoo 


Page 40 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 21 


50 


I 


£ 03 L- 3 

5 z a e cr 


t it cj *- c cj 

cn z x o c ujc _i o 

UIGSOIiC _J If! y_I GuJl 

2 C Q • U O it 2 * V li. 03 ac U. ® 

i ifl rj j « o *r uj cct-oN'ixa^ 


JO t-i _i i- O UJO 

- _l UJt-Ul_ifVil_iI 

- u. uiixouz ► >- x co 

•ONcxiiar ct-GM 


H- O 03 CJ i X 
*-* _/ 1-* O UJi O 

ut-»-c3_j<rx i _ix 

03 03 3 Ld Z * >- X O 
Cuiiii:r<n-on 


r -i q t a co-5 O'O lu ox o 

«r z cm <r z n «r z ct • t-^u. _j z — _i 

X - 2 X - it X — lit £t - Z) - >- Z -< 3 Z 

0_JXi<r^_liXi<Xr-J_JiZi<XMuJCCiCLCt- X _i X CC 


(3 Ci _J 

■4fsiXx*-4«X<E— _;<i<x 

. z . i5-czc^a 


_i Ou 

22QzoiirNizozl2-iG^czc^azc3<iChruiGhazc-rjiG^a2««««Hiu 
■5wj«j:wUTjii:«u~x!,*i:u3J<icu3_!<rcccciruo3"iXir!£03j«ju)")xu5r(flj<icc£i:ij'uonx 


LLX_i*-<<r«rM 1 i:ci:ii:_i < iu.x_jt-icl<i*-»Ci:Li:ccct:t-<rsi^a.^^LHu. f -.fsiL-. 

XCJX©--i= l Z<X<I<I<XL-£CJX©i-|i=.Z<I<X<X<X2Z:>rXZ:>:exZ© 

•Gxinitflj^ccccii'utmxinrwJCiciiLCu-iETUTtTUTc 


o a _i c. 

Z©CE2Z©:E©t-CJI<IOZ 

■’riu'tiEtnxtnuuJj 


i>o- r in<rtis3Mj3 

~3<r<T«-<r»rM*r<r«r 

oooccococ© 


O' © — r-4 M V 111 -0 

<r in in it in in in 
oocooooo 


N X O O -1 CM r*3 
Ifl in 3 -O C >0 <1 

© © © © © © © 


<riiT'Orscooo»Hr-4ro^-in'OPscoi>>o»Hr-4M<T5T'orsooO'0’-tr-jr»3 l ^iiT'0( s 'CDO' 

■O'O'O'O-c-crvr'-r^h.rsr^rvrvNrNmaocDCOomcDcocoooO'O'O'ChO'O'O-O'O'O- 

OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOjOOOOOO 


o r i m <r 

o o o c o 

*r <r t <r <r 

o o o o o 


lil'ONCDO'O- 
O O O O O ^ ' 
<r *r <r <r -r <r < 

o o © © o o < 


HI MI O h « 

, H h h h rj fj rj 

• m <r «r m <r *r <r 

> © © o o o © © 


:'C3-«iL'.^li3N‘ 
'•'’^"ITn-TTTT - 

i c* ci ri ci r, r, ci ci r-i : 
5©oo©o©o©o< 


i ui m i3 i*3 n » n r-i m n in r-i m *t ao r-i u m in <r ro 1 *?• © o<jCMn^-o<rr3n 

) i *3 uj <ro«r<r©'C* , Lj <r o c m orouj <r o <r ro ©*<ruoo^-uj© 

i r-i ro CD n uj r-J « o o n n is rj uj rj <r >o u. u. u. q cvi w * n uj rj| <r *o u. u. ti. u. uj rj -o ro uj n «o ro uj 

jnuurmni , 3uonuiijrif3M' , )iijHHHur3uiijnMri"iu)HHri-Mtuouu.uouii. 

3ChuiL©MUTCDiii©on'ON<uu.r-i<ri;‘)'ors«Qo*-i*T'olo‘UUJiLO*-«r4^-NO'UUJ»Hfn'0 
3-o<3'Orsf^!\rsrvrxQococoa3a:cDOOO->i>o-i>chO<t«i<i<t|©©©©iXiJCia5iiiiiiiiiaiaiuuu 
i cm n ci ci cm cm r i r-i r-i r-4 cm cm cm cm cm cm cm cm cm cm cm cm cm cm cm r-i n| ri r-i r-i rj cm r-i r-i cm r-i cm r-4 r-i r-. r-4 r-i 
>0©00©000©00©000©0000000©00 0©0©000©000©©0©0 


CO 05 1=1 © r-4 

CJ U CJ © Zi 

r-4 r-4 r-4 r-4 r-4 

o © o © © 


IfiNIUu-OC 
mmSCuLII 
cm r-i r-i ri r-i r-i c 
© © o © o o < 


oficz <r iJ <r Ci 


r -4 x 
r-i cj 

: <c u h- 

- - i=l <L 

i 1 X 1 ill © <i r ; 


X X iS | 2 X © h 

: o © x <x x I w x o -xfM<rx c 
I o - U •• L. | X © O - X » Ld 
>x.=.coaizxx-ixi=i<r©*zxc 


hX4N'-G£lNGGI 

iZuZILOtZGt. 

UHjimtMitrGij 


J4CHU1 JOG Jii C © X <X © _i XX — €^«©«X-< XX_i-iX~iX>-i-X<E2<I-<NI©.-*2©-4_lX -NXOHOJii.1 -«NX©~.©_iX — 

ix‘-xoioo<iONii=iOzc5o<t'Mzr©'-xQocizxN£z<c©z©z©f-L-cx4Xzox£ox©i:'Nxzzazc-a:z , NixzzozccxNix 

jx(fljiJ££unj£Hj£unrt-)rcn_ij£j-«uTCJ*3UE^£ME03a3'3jj''Sj"5i:j-juTUTHtC£uunu'’~c<rrcuTU 


.1 J£ - JEUT- 


I|3 -O N CD O- O H, ri T L3 -0 N 03 O O H r-4 f3 «r ll3 -0 MD > O -* r-i M IT L3 -0 MU O- O w C-i « «C ||3 -O N CD 0- O H r-4 f*5 <r u3 -C N CD > O H fi M ^ L3 -O N 33 > O H n n -C i,' -o n'cO 0- O H ri n «T L3 -0 MO 
^^!P^!0^^^^^^' c ' c ' 0 ' crxrsr ' rsrs,s - fvrs ' rs ' ,v ® c:0aDC0CC,CD::i:>CCC0a:,>!:> ' 0 ' Ch0 ' i> ' i>0,i:> ' >!::>::>ooo o©o©o-'^-’-i-''-i^--«-H-iririr4ririrjri ni ri .Mf^mrimmrom^M 
n r-4 r-j r-4 r-4 r-i cm a r-4 r-i r-i r-i ri r-i ri ri ri rj r-i r-i r-i r-i r-i r-i r-i ri r-i cm r-4 r-i r-i r-4 r-i r-i r-4 m r-i r-i n m n n n rj n r,« m co n tro n w n m m « ro « «3 n ^ ro -i n « ^ w « r, m n m ro n 

0©©000^©0000000©0000©©©©0©©0©©0©0©000©0©©0©©©0©00©0©©00©©0©0©©0©©0©0©0©0 0©©©0 0 0000©© 


i ui ii. O H « fl N c a L. O ri "1 u3 I * J h « -c N C u Li H ^ 1,1 CD <1 a y L H f-i nj-0 > 
)uuaacii5aac;05jiiJui5i'LUaii,iiLiLiLii.ii.iLOOooooooHHH l H-. 
| H H H H H H H rt rl W r. H « W H H H rt rt H rt rl C4 r-J ri n r-1 M M T-i C'l Ci f'i C-J r-| 
>00©0©©00©000000000000000 0 000©0©©00 0'00 


flQ^n J .©rirn>OiM <x 
h h ri :< r-i ci r -4 r -4 
r-i r- ( r -4 cm cm r i ri r-i r-i 
©o©©©©©©© 


Number 21 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 41 


51 


u 


Ui ! 


© cj z x cj 


u ' o U ' 

Z CJ £L Cl Cl 

> ' ' O ' ' ' < 


' u <r 

*- g ► 

o z x cn z x 


Cl CJ » C X 
JO' JL. 


► -I <1 _J CJ 3 


Z X z 

Z N Z 

c u a 

cj o o cj a 


05 CJ M 

CO >- 

: x a. j i a 


Z 05 a cj 

•> CD - * 

x <x <r g Ly 


x<ecx.j*iggcjqxxxxxxxxxxxxxx a. 


*-* x «x o x 


: <i ►- 

J N k- 3 
5 -! 05 Z 


«*-•*-* 
uZif 
_ <X CJ - 


x r> 3 :> x 
< z o *i o a z 
; *-* z u z z ^ 


^ -i x - coo 

3 _i u_ <X X il)Ju.5X5X5X5XMXHXHXXJX«5 
0<rCGCJN>3<I00ZC5Z0Z0Z3Z3Z3Z(JX;jG0 
ruu.-u^CL-ja.t-.z-SMZ-iHZ-Z'-x^yjzi 


© 0 - < 
o o * 
in in u 
o o < 


• in «0 fv 05 O' o 

, H H H W H n 

) in in in in in in 

>000000 


— n m <r in, 
CM CM CM CM CM| 
in in in m 1 


• 0 r'*© 0 ' 0 -* Tim*? in - 0 r'-© 0 'O-< CM fO*- m ' 0 f^© 0 'O-H CM f* 5 *rtj‘ 5 'OfN© 0 '©-t nm 

n n n n m w ^ m « n n m « « <r wt <r <r <r *r ^ <r ii 5 mi ijt ii 5 u 5 n in n iti -c < -c 

in in in ii -5 iii in li "5 iii in in in in m in in in in in in in in in in in in in in in in in in in in in in in in in 

00000000000000000000000000000000000000 


V n MD O- O - n « «r „5 -o N CC O' O H r -i M ^ 111 -0 N 05 O' O rt 1 

'O'C'C'O'O'CrvrNrNfs.r^isrvrNr^rvcccrcccxcDcccocDttcso'i 

in m ii; in in in in in in in in in in in in in in in in in in in in in in in in ml 

OOOOOOOOOOOOOOOOOOOOOOOOOOO Oi 


Ul«OUIMOOOOolaO'OI‘)<tM 1 
*? in o *? *r o in in in o t *r o m ci m r-j 


<Iw<Cri' 0 C'CliJ €-0 

nnunnmuiiU" 


CO<IDliJli.CUKICI^li5-OlDI>CUllJlL^OHfJ<ni5(D&'<I<I<I<I€QlijH<r-00,iSQOn^M>«UuljHVnOJ5' 

NNNNNQ)0DC0CDCDC0a3C0C0CD(Dt0a)|CM>CM>-a'0>lM5'0'(MMM>>!)'«<r<I«X<I<IlCiaOi£ianIiiCiiIifflUUUUU 

mmmmmmmmmmmmmmmmmmimmmmmmmmmmmmmmmmmmmmmmmmmnmmmmmmmm 

0000000000000000000000000000000000000000000000000000 


u-c-OM-OMij5<i<iQ<rnujQoo'MiijQHca«inQrsofOHnriMM"’'Cn>oi 
u. cj m rj m r -4 uj n m m cj m rx cj m m rj ix u uj m m u g cj g n r i rs r-j rs r-j h. cm m rj m i 

rjn , rm < or^© 0 'au 

.' UJ UJ UJ UJ 

m m m m 


<r-oo-iiiGoC'i«rr''.(>'<icjGu*-««rinco0'<xGuju.c*-><TincDO'UQO»H > ,,, , u , v ,. wv . 

CCCCCOnliffiilifliaiitiiSaiUUunnuUUUCiaCuCluwCiUl'aJliJIiJUluuluJUUIUJlil 


000000000 000000000000000 


ui u. *-• r-j m *o rx <r| 

luLuU.LU.u.u.ti .1 

mmmmmmmm 

ooooocoo* 


Lu Uj 
G 3 

z <1 
c cn 


►h as 
CD LLi<I 
O X _i 

Cl. H- _ 

*- >- aJ C 

0022 ) 


J 

a 


U O it 

3 <1 X 

-J _l CJ 

Sl. u. o z c 


jXGGGOUJZGZZ> 


_oic: 


r - - CXXXX _i < 

: ' cj x * g j n pi c ^ 3 o a - h- <z t- 

' * _ cc - - cccuusuou: • cd ► x 

.ZXXCDXXCJXZXXCJOOCGOGCGXXGXZCJC 


; _j g z 1 a g 


x 3 <r x 
Z O h- z 
- Z CD — 


X <X -< t 

CJ X G u. N : 

x _i _j u “5 £ 


TT n -O p ' X J- O - r 
ri CM rj .-.4 (M r-i r. m m r 

*r*T<r«r*r*T*r*r*r* 

oooooooooc 


r i /5 >o n m > o - r, 

; 15 15 M l', « <T <T «T 

r*r*r*r»r*r*r*T«r 

500000 0 00 


r *5 ^ in -c 

*T <r T *T 

*? *r «r «r 

OOOO 


laZulZOlT, UNUNONUN 
CD G 

Cl II II 

O 

G - M 

z 

u * # 

(S 05 


'X<rz>xv--x<ioxu. 


r 3 X u. <X ti 


x <r o x u. ► 


w'NCJNJ_;Z3ZGOZ3ZGOZX3ZOZXGZllN,XNJu_ k '3ZG!32Z 

fi-)0-5fl-ZHJZHZHJZHTrHtHTj«u-;0TUntHjZHD 


^ w iC^iC££iCXXN^JXXC 

G2<I«X<E2CJ2ZZi=i02Z»=i 

J-IirCCiCHQHW-JJtHHJ 


O' O " 

<r m ii 
*r *r * 

O O < 


m w <r in o 

1 in m m in 

r *r *r *r *r 

5 0 0 0 0 


- x cJo 

m mi >c 

r < 3 - *r|«r 

>o 6|0 


>*■ *-> CJ 

cc Ct a 

"1 r i ^ ^ l *' ) *0 ^ 23 *>• ° ^ r J m m *o rx co O' o 1+ nm <r m -c n ® o» o ** c-i m in •« rs © 
O-C-C^'O'O'C'C-OrvixrN-'.rvrvrs.NNNcOcCCDCCCCCOCCCOCOCO'O'O'O'O-O'O-O'O' 

ooooooooocoooooooooooooooooooooooooooo 


0- O H M n T !/5 -O N 

o>oooooooo 
in in in in in m in in 
000000000 


in in in m 

o 000 


ro "5 in 

o 00 


■**5 n) m. o 

o o o] UJ 


m 

o 


in 

o 


o 


nil ro rn n 

00 00c 


in m m in 

o 000 


U. N *4 O M- O' O 

"5 5 1500 © O 

■5 U r-j r*) X C C UJ <1 1/5 ii' iC fi 15 h h <! uj 

ci N r-J uj r-i k) a. cj u a n u m g cj - u. 

9-«au/ii.on<i(oiauaui«Nnvy5 
^iUjLijuijjU.U.U.U.^.LLU.U.00000 
r-j n r j n n n, r-j r j rj n rj n *i n 15 m 15 
000000000000000000 


o <r x) <r cj r j 

*- O *r O' «r o- 

■IN^ I5M c G <T G <1 G <1 G 

U N h fl U 15 >5UI5U«UI5 

NdBuwonn^m^ffNxacJu 

OOCOOr-^^-i-H--.^,-,-,-/-,^ 

OOOOOOOOOCOOOOOOOO 


<ri 00 

-o rj 


U CJ <X O « T N M H ^ 

CM <T O' Ci O'C’CJU'CCJ 


oI 

2 l 


15 5 M>> CG 
r j r j a c-t a a 

151515 15 15 15 
OOOOOO 


f*5 O >*5 
r-j m -■i 

Uj Ll —< 
rj rj m 
D 15 15 
OOO 


<E 


r-j 

m 

o 


Nf5 15 -C >5 O »5 15 <1 •O ib C ill 

n r-j cj w r-j n r-j u m ui 'i u u. 

m -o r' « cj g m u. ri ud ix O' cj 

M 5 Dnrofor* 5 f < 5 *n«r T<r*r«r 
>5l5'5f5l5t5l5 , 5r5'5f5'5« 
OOOOOOOOOOOOO 


— 1 o o uj <ro<r 

'CU'Or-j w O'©*? 

<iui<r'C?n<rN!om-^<x 

U u. U »1 fl “1 N M U -■ t*> 
UI--M'0©O'CJQUJ*-i^- 

*r m m in in in in in in c 'O 

' 5 t 5 f 5 5 l 5 ' 5 r 5 r 5 f 5 r 5'5 

ccoocoooooo 


m 

o 

© G 

fD -C 

^U.LU.Uai5l5ri4M5l5« 

N!><r«UGUJU.Or55li5'ON 
'C'O'C-O'O'C'C'Oixrxfxfxrsrx 
>5 5i5!5,5 p 5MI5l5l5f5l5'5l5 
COOOOOOOOOOCOO 


Page 42 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 21 


52 



I « 


) * u ui in 

5 - - - X 

: z x z <r <x x 


CQ u 

z i z x z : 


< X I _J X Z> _i 
• X !_• I'JC <1 

: x _i x r cj 


x :> o _j x : 
o x x o <r 2 c 
r »-• x r cj m ; 


ia.XLUXau<EC(L 


ja<xuooasct; 


< X t-H i- 
> 2 O LlJ 

: t-t z cc 


i Z> Li- U U. > U. _i Z> Li 

IQINZCCEN-ICIN 1 
jiun'tu-njr.: — 


n cd D- c w r-j m <: ii - ) <o n co o- o h (".j [<: -r iii >c n ® > o h r; ^ 'C n w i> o w ri n *r n >c >. co ^ o h r-j m 1 

fXIXfXCOXXXXXXXXXCXCxO'CxOCXCXCXCXi>OCCO©OOOCO~^—C-i “iri r-il 

••C'O'O'O'C'O'C'C'C'C'O'C'O'OJi'C'G'O'C-C'C'vorxrxrxrxrxfxrvrxixrvfxtxtxrxrxfxrxfxrxrxfs.fxfxrxl 

00000000000000000000000000000000 ©0000000000000o. 


- X X X X X 


CJ J> U U I- U X ^ X - 

ZGJTN'JSliJCU^ZU; 
Tr UTiiOCxOrHCc 


UaXAUL 


i U A X I 


■ X X _l 

s <x o u : 


J X I 

• ► c 

. X <X r-i 


M_iXG>Ou.OOXX: 

ox'j 00x0022: 

XJOXX-xxr-tMs 


<r ii* -o mb o o h rj fo t iii >o n co o> o r. : f n >c ■ ■ co i> o h to » n >c n cd O' 0 

rj r. a c-i a ci 

rx rs. ^ x. ix ix rx *x tx rv rx rs. x.. fv rx rx tx •, rx x. ix rs. <x rx r-> nnxxnnnnnnnn 
OOCOOOOOOOOOOOOOOO OOOOO OO OOOOOOO OOOOO 


in <r <r 

00 0 


in 

o 


LG *T 

o o 


in 

o 


LI 

O 


u © m to 

<3- *T <3 f 


X O 

<3- r-i 


c 


o Ci o ci 


ox o 

cm u_ 


-1 m 
o ^ 


o 

r-i 


-0W»-Iffl<IOO«’-ii£iw«O!CiHM5-C'0'C0> 

M r-4 LU r-i Ui rx r_j |X r -4 fx fx CJ r-4 N C-i !X a n r-i m 0 


uj ci ci in r-4 n r j n s u a u n a u o c: x 


<r •■. w5<IC-J.-A'0tM). 
Cj'iZi !X (Si CJ O UI CJ UJ Ci n Cl CJ 


<r Si <r =i m 

r-i a <r <r rj 


amt*)M'Oujuc»iiJUJXfnujiij 
<r o ci c-i - rx u. u ^ Xu. u rj r-.. u 


tM> o- »■ 1 u a o h f J ti -c n a 
rp 111 cf i pi m rn rfi 3 s ^ 3 * O' ^ O' O' 

<T<T'T'?'?<T<?<? r T<T*t<TT'r 

OOOOOOOOOOOOOO 


O' CJ a Ui LL 

Os O O' O O’ 

•3- <t <r <r -? 

OOOOO 


o 1 n t '• 
<XC<E<X<T<I 

<T<r*?<T<r<r 

000000 


rx ?v rx cc a, cj a; 
<X<I<E<I<X<X<X 
<r <r <r «r <r <? <r 
OOOOOOO 


ui u r -i to 

X C A A 
T <f <r <T 

0000 


<r \ a ui u. r-; cn x o- 

A A A A A A U U J U 

<T*T<TT<T<T<r^- r TT 

OOOOOO OOOO 


o 

<r 

o 


-< r-i in x o- <x a cj u 
a amAuaaaa 
*t <r<T<r<r<T*T<T<r 
OOOOOOOOO 


U O O 

a uj ui 
«r «r <r 

000 


o o r-4 in <o 

Ui Ui UJ LU Ui 

<r <r <r «r <r 

OOOOO 


rx x uj cj a ui 

Ui UJ lu Ui UJ UJ 

t *? <f <r <r *r 

OOOOOO 


UO X O'- <x 

U U u. u 

<T <r T <3 

OOOO 


U U C <H 

uuoo 
<3 *r ui in 
OOOO 



XM<EXMX^<Xhh; 

uzacjzugzg; 

wlJOTuEHXt 


• E> X X 1 -t _J u. I-. 5 
. UOXOXCC©: 
)~XTu.JCJ£lX‘ i 


: tx h x _i i _i x c 

: z x> 2 x cj x cj : 

i IE H 0 X 01 X ' 


>GHi£CC UliHH H > I- li H CC X U- <1 H- 

] 0 ZAA-I<IullUQ 01 iJZXUNZE |0 1 iJ 
[ECitltAiE^Ln^EAHjQlwIJA 


j HH x •-< *-< 

: o 2 o o 

j x >-< r x 


AXNH) 

UZZGi 
O *-« ~5 X ► 


r-j ?<i <r lp fx a? O' c <h rj rn <r ut -c rx x cs o cj ro <r ut -o rs x o- o •" ri r<i <r lt <c !x x 0- c r-4 ro <r ii"5 >o rx 00 os o <-< r-i tn <r ut >o fx 00 cx o <h rj n <r ut <o rx, x ex o -m r-4 tn <r LG <0 rx x cx o th ri tn <r ij - ) >o 
o. £»• a- O' o- o »■ o- o o o o o c o o o o h w h w h h 1 - h ts r-i m r-j ri ri r-i r-i r-j r-i r-i n tn m n pi n m « « « <r <r <r <r <r <r <r c <r <ni mi lii lii lii lii n n i3 >o <1 -o <1 -o >o >o >o -o <0 n n n n x x n 

illu'L'li*li3LTIill''C'0'<3'0'0'0'0'C'0'0'C'0'C'0-0'0'0'C-'0'-C'0'C!'C'C'0'Os3'0'0'C'0'0'0'0'0'0'0'0'0 - C'i3'0'0'0'0'0'0'0'0'0'0'<J'0'<J'0'0'0'0'0'0'0'<l'0'0'0'0'0’C'0'0'0'0'0'0'0’0'0 

000000000000000000000000000000 00000000000000000000000000000000000 o| 0000000000000000000 


«T lii 

o o 


<r <3 <3 <3- ui © 

O OOOOO 


in 

o 


in 

o 


in 

o 


sQ M >0 UJ O O 

-* *r r-i c-i r-i r-i 


O' iil U COQ 

Ui r-i rx r J r-i r-i 


•o a fx 0 <x 

-< o n- «r w 


u. o <1 u. rx o 

o m m <r o u. 


o <1 o rx 

nn-oo 


O UJ >o| 

y-t SO *0 


rx o <r o 

r-i o m 


x o o rx 

rx r-i r-i -<r 


a r-i <i q r-i is >o m sc m sd m c uj 
m o to m cj r-i tn r -4 w a to r-i —* u 


c <r uj r-i uj <1 n « ui 

UwU AUQNUA 


-c « « IT r-i -o n r i su r-i a tn 
^ r-i r< o u n r-i Ci uj r-i u cj 


rx'O'OUi-C'OuX'O 

3UiUUAU<rMii 


U' 0 UJC' 0 rx 0 'Cj-<<Q<ifntn'<r 0 ' 

HuuauvuMrtnuHUHU 


<I'C!<1Ui'0QMr-i'0M'0!<5('J0' 
N M N N !1 !<! W U M C i m r-i r-i u 


U CJ 


n m 
o o 


Ur-4M'CM><XuAUOr<K)'ONO'Ulii-irii1'C»'UAUO 

l o o o o o o o o o « h h w h h rt rt r-i r-i r-i r-i r-i r-i r-i r-i tn 
tn<T<r<r<r<r<T<T*3-<T<T«T<r*3-*3-*T<T<T*T*T<T<T<r<T<TX-<T 
000000000000000000000000000 


^ r-i iil N A A U U 
mfofnmrommm 
*TT*r<3-<r«r<T*T 
OOOOOOOC 


OWflMM-r-OACA 

<T-<r<r<T<f<T'<r<r<T<T 

'T'T<r<T<r»?-<r<r<r<j- 

0000000000 


u o »-< 
«t ut in 

<t <r <r 
OOO 


m «r iii so rx 

\n ui m ui in 

<r <r <r <r <r 

OOOOO 


CX 1 X 1 
lil UI 
«r <r 
o o 


uj o rt r-i 
Ul sO so so 


OOOO 


tn rx 


OOO 


<x cq'u 

<o <OI<C 

<r <r|<r 
o 00 


u o o o o 

>o rx rx rx tx 

<r <r <r <r <r 

OOOOO 


m ui -c x <e ixt cj u ^ rj <r 
txrxfxrxrxrxixrxcoxx 
<r<T<T<r<r<r<r<r<r3<r 
00000000000 


n x 
x x 

< 3 - < 3 - 

O O 


Number 21 


Dr. Dobb’s Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 43 


53 




i X >— X X 

. 'I 05 <t 3 

o r*5 w • o n ro ' ' 


o o r-j • oopi' 


wuuuuuuuuuauuuu 

o; xaa;o5»iasc^a4ii.ac.o5sajio‘*ia^aai»oTi2i 1 5i5xai*ii 1 c^iXi*f/)ii l aia4y5iaJ5ai05iii 1 iiiXi05iaiiiiii05iricaiiio:fliiBi3icni3iCQ 

*-• CwC<ruuw«uuC<iflwu<iHuw<iciaw<:aau'iflaM«Mua<rflflQCQuu<:i3Cia«aaa<iQOfi<iaafl«pM 

01 


iMIIiDXXl 

u<rQ3u<Iuu 


o T-t r-i ro u" < ‘v cc cp o — rj pn t n >c P' a: s> o -- rj n <r ut >o n cd 0 * o «h rj n *r iii >o rv oo i> o ^ rj r*i *r ut -o rs 03 a- o -h r-j r*i «r ut >o rx a) i> o ^ r-j to ^ bo, >o n 03 £► o rj m 

Pi PJ P< PJ Pi j Ti rj Ti Pi f*l « M M M ro rj « fO -T ? <r C T C C «T <T ill ul lil tl lil tl ill 1,1 111 L5 -0 -0 -O <1 -0 >0 -O -0 -0 <1 N N N N N N N N N MB CO CD CD CO col CO CD C0 CD 5- 0> O O 
CCCOCDCDCDCDCOCCCGCDCCCDCCCCCOCSCOCDCCiCDCDCDCOCOCOCOCCCOCOCOCDCDCCCOCDCOCOCOCOCOCOCDCOCOCOCOCOCOCDCDGDCDCOCDCOCOCOCOCOCDCOCOCDCDOOCOCOCOCOCOCOCCCDCC 

ooooooooooooooooooooooooooooooooocooooooooooooooooooooooooooooooooioooooooo 


I 


i - o uj fj h o -o n n o uj Pi o n h <r o -o h o uj Pi oo o -o ^ u. o Ijj pj n o n h n o il 1 -* pj o n h pi o i 
i®uc<rouo<rcaouiOi=iOuiocio«TOujc<rououi030*-030<ro©ouiooouio-<©Lio« 


oh.*, rO'0f''C00-uciLju.cNn<rL')C00'<i.xiujL.o^^in'0N«aiijCiO^rjn-or^cD0'Cj!: 


"jCMJ-aO'Ciuii.CHfn'i'flMcuuUu.'O'rbi'O'iaui: _ _ _ _ _ ___ 

,.u,UiiiUUiiiiiiJ^LiLii.LtHtLu.itiLiiOoooooooHHWH h - h w ^ h « pj n rli pkj r-i n rj cm pj w n n fi w h n w n m v ^ <t v Vi «r ^ t «r <t in' Li 

.1 Ul Ll Ul ul U* Ul i.! Ul Ul Ul Ul Ul l! Ul Ul Ll U1 HI Ul -<3 >C 'O 'O S3 O O ~0 -0 -O O -O C 'C ~C 'O S3 S3 S3 S3 -O S3 S3 S3 >0 O -O S3 S3 S) S) S3 -O 'O >0 *0 S) S3 S3 S) <3 -<3 >0 >0 S3 'O' S3 *0 S3 -<3 ss s> -o sj 

gooooooooooooooooooocooooooooooocooooocooooooocooooooooooooocooooooococooo 


3 U. UJ < 

« u. ic c 
<ICuC 
J * i . 


uj <r u_ 
C O “3 


CO (J 01 c 
Z O Ui 
H JO- 


- iZ 3 

3 3 a. UJ 05 01 

3 O >- I O O 

. 03 I— LL U_ 


i 3 01 III 01 

cl cc a h- 

C ll CJ 

2 CCilCuJ 
it lC G “1 

3 LU 3 a 

p- 3 2 0 
UJ CC 2 »-< 
liO" 2 U. 

3 2 2 O 
CD 2 M 
touHisa 

_ X CD 3 2 

ICuiSU 

05 iXi 




X X I, I X 
iXXXXXwl'OOO 
JCDOmOCDUCiQIUJU. 
• h n PI M M o o o' c o 


-CQ3U.U.U. ► 
© 03 3 3 3 5 

_ - UJ _J 3 3 3 l 

o o o' o o o o pi -i r; Pi o o o o o c o n o c cc a a c ■ 


U-iL£XiLiCG«u.<IilNa:u. 

2322X2CKrxr22X 

itHHiHtinixLnHT 


-h c-i m -r u3 -o p. co O' o cj ro <r ui -c rs. co 
'O-O'O'C'O'O'C'O'Orsrvr'rsrprvrsixrp 
i\rprNrsrvrprprvr^r^Psrprvrsiv»Nrprp 
oooooooooooooooooo 


3 3 3 3 3 « U 
lMfiS3CCaiiS3u;GaG32uC5 
luuwuuCLJUjuiUjJ 


G JIl J 
cu-u.cn 
3 3 3 2 
Ll_ iXi CQ •_ 


o u c 
3 O C 
* 3 . 
<1 K C 


a 


u 


. 05 I- 


i a: o _j 

5 U 3 O 3 U *- 

J003X20C.C01 
:33iC3 - Z32 
i Cl <1 UJ * Cl Ui G h 


0-OrtPJM<TlilX3NCD|0-0'-iriMVIil'OPGI)>OHriNl«yl'ON(I!!>0- 
NCDCDCDCDCDCDCDCDCDlCOCPCPCPCPCPO'O'O'CPO-OOOOOOOOOO'^-' 
!^^!^ rsrv|vrs - rs,SNrvr ' r ^ rvrNr ^ ,s ' N, ^ , ^ r ' sCDCOC3COC 3® | 23®rocDCDx 
000000000 0|00000©0000©0©0000000000 


«r -r *r *r •? -r in <r 


• til r-i <r «r r-i 


rO S3 CO CP <1 Ci 3 

o o o o o o o 
ui ui li ui ui m in 
© o o o o o o 


U.On<rii 5 ffi(PUUt 

in Hi n ui ui ui in ui ui u 

OOGOOOOOOC 


*?■ ui -0 rs 
cm cj cj cm 
iii iii ui in 
o o o o 


cd o co a cp ai 3 
pj m n cj a a u 

CD CP <1 l& CJ m 3 

r-j r-i r-j cj cj c-ji cj 
L l Ul Ul 111 111 111! LI 
0 0 0 0 0 0,0 


' Ul IN 
Ll % 


30—iCJ«r-XU33OCJr0«TUlfSCP0-0'0'0'D'<I 
cil*linni*)i-iin! , lin^<r-rT<T<rt'r<fT'rT<r 
in ui in ui ui ui ui ui ui ui ui ui ui ui in ui in ui ui in ui ui 
OOOOOOOOOOOOOOOOOOOOOO 


O > Ul L 
*3 I* 1 . T < 

O S3 D PI L 


rs rv 
Ul Ul 
o o 


Page 44 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 21 


54 





oxcni'i- x x x x m- it it i ^ ci u oa cx<rx<ri<xiCL o 

<r in x -• o i <r ci o - rx cn u z :> x x a x a x x x a o z a a: o z co z x c x 

XCiOi.UCLOCJOOItJCtUCC Ci »-i ZCOC<tCO«OCna)CO'C<I«XiIiO «CJOXCO 

O- r-i • OO-H O © ->-< ■ OHOOfl' COW' O O ' OOT-t' OfiHx O «T *-« ' O -O' CM ' O W c GD rt O O " ' OCS-^' C O- H • C © ' O O ' © © ^ o O — © CM -< • © “i 


CJ Li U O U O O O O I U L> CJ CJ CJ CJ U U U U 

Xfiiri£CCCnSAfi01CfiCC£^CSAlOCASU)fiiSAO^AASCf>CACCOCA|CUjA£CiSC^i3A>>iUiiiCiiXii£U)i9AiIi(niSAXO'!iXiAi£'RCiZiACOfii4i!£En3ACu;CaCi) 

Qu<raco<iciMM<iuCiuQui<iwaM<iuuo<:wwu<ioau<iiaQM<iua|w<iaciaaa<iuQCi<rui3u<iQuw<iQca<iawM<iQCiw<rjOuCQCQ<TaQ 


o- c h rj n c n -o ms > 

NCOCOCCCOCOCOCCCCCDCO 
D > ^ Q* O' O' O' O' ^ O' 
OCOOCOOOCCO 


o cm w ^ ld -c rx co o- o »-* ci w v in -o ix cd o- o cm w in -o rx. as o- o *-< r-i w *r in -c rx co o- o «-i r-i w <r in -o rx co o- o th c-i w «r in -o rx co o- © --i ci w -r in -o rx co o- 
o,j. O' o- O' o o i> o- o> o o o o o o o o o o h w h h h - h hIh h n m m ci n n r-i r-i m r-i « « m m "I n w k ■o m <r <r <r <r <r <r <r t <r t n iii fi n n n fi n nn 
O-O'O'O'O'O'O'O'O'O'OOOOCOOOOOOOOOCOOOOOCCOOOOOOCOCCCCOCCCOOCOOOOOCCOOOOOOOOOOOO 


iucujriW’ri 1 'icDi><riiiuciUJij.o^riw<ruT'OfxcoO'UCiUjij.r-iw«ruTCDO' , <:aiUjLi.CT-iriro'CixcDO'UCiLiJU.rjW'«»-iiDXO'*xiiiLiJLLO'-i«riiD'0'x<x*ucio--' 
iCCQUJUiUJuJUjUjUJuJUJUJUuu.u.L.u.Li.L.u.Li.u.u.u.L.u.u.oooooo|OCOO-4rH-t T H-4r-i.^TH^^^-Hr'irjc-4ricir'iriC'iciC'iwwwwwwwww,'nT'r 
)'0'0'0'C'0'0'0'0'0'0'0'0'G'0'0'0'0'0'e'C'0'0'0'0'0'0'0'0'OrxNNNXNlXNNNNrxi'''r'.rxKXIxr'.!'', rxNNlNf'f'. r''Nrxr''NXN|XN N!''.!''.f''Nr'.r'N f'. 
^OCOOOCOOOCOCOCOOOOOOOOOOOCOOOOOOOOOOOCOOOOOOOOOOOOOOOOOCOOOOOOOOOOOOOOOOO 


Ci W -OfXCi 

«r <y *r <r 

NN x fX LLl 
O O O O it 


5 Ci ^ - C W » 


COW' o c - 


O O CM ' C O CM ' 


i a a ci a c a x c a C ji i 


CJ Cjj 


01 fi is fi L0 C 


I 


T ID 'C N CO O' C h Ci 1*1 C III <1 N CO 0 C h C-i M ^ liT -C X CC O' C h C-i K ^ 11 -0 N CO O' O h M !<; ? tl "O N Cu O' O -4 Ci I*) V t' -C N CO O' C J f-j ^ ^ lil ‘ij [\ 0! O' O f i W *T LI •C N 03 O' C Ci 

»• 0 0 - 0 0 - O' c c o o c o o o c c h rt h rt H rt h h ri n m r-i N n n m r-i r-i w n n k n « w n w w ^ «r <r 7 ■? -r t « t -r lii mini in in m in li in in -o -o -g -o -g -<3 so g -c -o r-~ ?x r-. 
COCOCOOOCOCDO'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'OO'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O-O'O'O'O'O'O'O'O'O' 0-1 O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O-O'O'O' 

00000000000000000000000c.000000000000000000000000000000000 0|000 0 00000000000000000 

L) CJ U CJ i CD CD 


*T Ifi CO O' < 

in in if) in i; 

G G 'O -0 ' 

o o o o < 


i U U. O -rt T m 

: in li g g g g 
j g g g g -c g 
>000000 


g rx <c iii u 

G G <3 C G 

G G G G G 

o o o o o 


■CNN 
-o-o-o 
o o o 


cm w rx co O' <i 

X N N N f> N 
-0-0-0 G -0 o 

o o o o o o 


C, Li u. O 
rx rx rv CO 
•o -o -o -o 
coco 


t in -c 

CC CO CE 

© c © 


rx a; c 

CD CD C 
G -c -■ 


y 

> G -t col 

> fx O 'T 

o O' <r| 

4WW-WW'U'U-WU'U'U'V>U'U'iU>iM^'£^ <C|'* 

2GGGGGGGGGGGGGG CGGGGGGHG 
>00000000000000000 00 0 0*0 

I 

i 


LiLl.OW'TLD'CrxCO 

Cissccaaia 

GGGGOGGGG 

oooooooooo 


a c a. Ci 
-c -C -o -o 
o o o o 


W <? If) -0 O' C Ci 
'J U U U U J u 

g g g g g g -o 

o o o o o o o 


UL - cm m 

CJ O c Ci Cl Ci 

-0 -O -O -0 -o -o 

o o o o o o 


Number 21 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 45 


55 



* i—< x <r 


J o c 
x 2 l. 


<t c/3 : 

2 X . 


< IX . ' — * £ 


■ <x x g co £6 cn 
j x x cn x <r x c 
; x cn x >- f— >- : 


. o o w — r: «r ? 

J J J (J U C.' U I 
i X © O O TOC 


<x 2 c 

-J Q ! 

X X 2 2 2 

75 X X O C 

X X X £- H- 

x cj <r <r < 

x £- co cj u 

o u g c i 

<r uj 
G ££ I 

2 <r *- >- 2 

*-* X X LU 

2 U 2 O UJ 

2 0 2 0: 

w X UJ CJ 

CD I H- 2 7) 

UJ f- f* 


_j _j uj 2 <r u 


X I X X 

2 u. o <r o 

X t-H w o O O 

: o <i ouoco 

' X CD 2 G G G X 

C O <1 tw o o o o 


-J -J 

HDjHJ5iS:<auiXj:Nu.GGG3GGG 

U50€5«0 3GaZQ2J22000 OOOO 

1 2 2 'J 2 G 2 CD 2 75 O X w X ~3 ~5 UJ LU U X UJ X X 


_J _J 

<r >— i— ’—> *—< —i —j w w 

X G 3 X X <X 1 Ni 2 Cl ‘ 

XCC2J_IUCJ-<tCJ- 


Xr-^QXu. 
U X <E U 2 
X _! |=| X ~1 


HOOXXO>-tNu.333X 

(C0220u.220C3a 

JJ2hh2UGGUJUJuJIiI 


-0NG0'O-'rj^<fl/)'CNCD0'O'Hf'iM<Tli5 

ri n rujio ro n m « n m m n w ^ «r <f t -r 
oooooooooooooooooooo 
oooooooooooooooooooo 


O CJ _ 

o cn x 
DC CL CJ 

-ON® 
«r <r <r 
o o o 
o o o 


****** 2 t-i * * * - * * * Cl <r ooito 

-h c j f*5 in >o n a/ > o ^ r j n <r liD *c co O' o r j r*5 «r JG >o ix 03 o ^ r-J ro ^ tin -o rs cn ch o t-i n ro <r n >o ^ co o* o 

o o o o o o o o o - - h - d h n w - - m m fKi tr; m di m m m m n tin n m n ^ t f <r t <r -t t </ 

OOOOOOOOO© DOODOCOO ©OOOOOOCCOOOOOOOOCOOOOOOOOOOOOCO 

©oocoooooooooooooooooooooooooooooooooooooooooooooo 


o 

o 


o o 
g g 


CO o o o c 

u. o o u o 


o o o o 
o c o o 


o o 

r-j o 


u 

CJ 


o 

o 


o 

o 


<t X O' O O' O' <TCN 

Ci CM h M -i CJ wo 


UJCDOOO'U.UJl_Ci*TO'CjNiZi<X'OjJ 

U-cjoo'o — or'woorjwowfxo 


o 

© 


O' 

r*3 


o 

o 


o a uj 
x ro o 


■cujr''Q'0iwCi*5cj<xr-;~i 

ci^^roocjrso-rNO'Ciu 

x r-4 «r g co <r x x x © w <r 
W 04 04 04 04 04 04 0-4 04 03 fO 03 

oooooooooooo 
©o©©oooooooo 


MflNM 
04 O CJ U 

>- 

ii3-oo<ioaaacii3Qq 

mromrxm^3fxr*3fDf*3^c 

OOOOOOOOOOOX 

©oooooooooox 


xmr<3w,-ixx«'0X<rx<EX<rx<r 

Cu-iOrtUUUwLUkUdowU 


£0 

UJ 


O'iX'n £D o* £Ci w<rrso3rouujo4r*3 

w UJ CJ UJ O UJ 04 h N ri M Ml (J U 


OOOOOOOW 

oooooooo 
o o o o o o o o 
oooooooo 


M 111 CC C6 J rt T 
C O O C O — —I 

O O o o o o o 

o o o o o o o 


"0 CO CD Ci O 04 if) 
W w w w O. 04 04 
o c o o o o o 

o o o o o o o 


n cc a a c uj 

04 04 04 04 04 04 04 

o o o o o o o 

o o o o o o o 


w 04 03 -c 'O O. CD 
03 Xi !^3 CO 03 rO f*3 

o o o o o o o 

o o o o o o o 


O'O'UXXXOw 

rofororofoco'ro- 

oooooooo 

oooooooo 


ro 'O a- O' O' 0 - ci 

<T *T T <? *T <T <X 

O O O O O O UJ 

O O O O O O X 


cn cd 

CO X 
<X X 


2 C 2 2 


u cd : 
<r ' 
j x cn 


: o u 

- x <r 
— x 

- 2 <Z 
4 O X 


X 2 O O 2 


< X _i w I _1 

3 ► ► 2 * » 

. I S Jh ft u £ 


w _j x z> r>u o o x x xw r» w xr>- 
OXCJ0 0 2G3022200XNJCC 
2_iQ22-?22w-ii-irrcj-;Q2C 


J U LL H 1 i 


<ulXCOQ2DX. 


li 03 O 
cn c/3 cj 

CD CD <X UJ 


(-OXOO CD 
UJ H- UJ ii O <1 O 

cD052<r#ou.a 


XD>wCJwiXXXXO<rx<E 
Ni2CX2D»22 2 2G l -2X 
-)HtuniKH-!-£inx 


X X 

C l m W 

X X Ci o 

X O >0 o 

u o uj a 

I ItU JO o 


X N4 X X 3 a 
2 2 2 2 3 X 

UTHG UJ 


CD <T 
> O X 
X _4 O 
O O X 
2 CD X 
X O 
2 2 CJ 


2 2 G X 
X w 2 u: 
_l •- X X 
<iDca 
©ox 


X 2 X 

x cn 2 
h O C/3 O 

U X CJ 
CD O O V 

<r xx 


2 W ,x UJ 
DCONH 

x x O' x 


£5X2 
X X CD 
2 m w 
w X X 
f- w > 
XXX 

o o c 

X 2 CJ 


X C/3 X CD 


»- X 2 

CD 2 X 

CD X h O 

XXX CJ 

x <r x 
x x x x x 

X 03 X CJ X 

■C X X 

X x<li> 
H X CD X D> 

X X X t— X 
X £- X X O 

*- O X I- D> Cl 

X 2 C X O 

G C O CD cn 


X CD X W 2 X 3 ' 

X X O ► ► 0 3 

♦ G<xa,G<r£Dr«x< 


x >■ 
<t 

2 X 


XXX GXXX X 

xcnxxxxxxwocnwcjwt-i 

<X3<I0GC<I<X0G3X20X 

GXGXXUOU22XG-32G 


00 


H "i 1<) <r 111 ■fl N a 3 O rt r-i M ^ 1(3 \ 3 I), o -> r-1 13 <r a3 <! N (E o. o rt n v J M33 o. o 

OOOOOOOOCww —i w —< i —i —. —; w ' 4 ■'•■4 IN C-4 r-4 r-J ,'•< '•< Ci 04 M I3 !3 43 (3 f) !3 N M ^ 

OOOOOOOOOOOOOOOOOOOOOOOCOOOO OOOOOOOOOOOO 

oooooooooooooooooooooooooooooooooooooooo 


w r-4 m t m >c 

<r <r <r «r <r <r 
o o o o o o 
o o o o o o 


« 13 ? ii3 M3 MS l> O H ri f3 ^ Ii3 -O MS 0- O rt N 13 ^ Ii3 
O O O O O O O O O W w w w w w w w w w r-4 C4 r-4 r-4 r 4 r-4 
OOOOOOOOOOOOOOOOOOOO OOOOO 

ooooooooooooooooooooooooo 


o o 

X o 

O UX O 

O O W 


o 

o 


o 


o 

o 

CD 

r -4 


o 

o 

r-4 


O '0 o 

o x o 

X ID X 

O Q O 



r-4 ro <r 

U CJ CJ 

O' CO M3 O 
X X O w 


O O O O O O O O O r-4 ii3 

ooooooooooo 
© o o o o o o o o o o 
oo©oooooooo 


«rXK3*TX**3^-'D'DXX<XXXX<X 
f <r (J <r ? o r-4 w rv x cj r-4 n x cj 

m! Nffl 3 U a UJ u. O r-j <0 i'. 3 O- •! U 
OOOOOOOOwww—i—<ww—i 
OOOOOOOOOOOO OO 0-0 

ooooooooooooooo o 


Wliiuif-iM3f3f3<f «MI3U.a r-4 CJ f<3 

r 4 m x x m w r m x w rv o g <r * g w a 

>- 

liOHN3 -O G O' <r X X X O :'3 <T fcD CD O' G G X 

— r 'i r-j r -4 r -4 "i m r -4 r -4 r-j MWrtiDMttnwnc 

oooocoooooooooooooox 
oooooooooooo©OOOOOox 


a ill x w a x x x x x un x r -4 x x 
GXGXXGGGOr'GXXfDX 

OOOOOOOOOOON<TN!3Mlk.3;^t* i C“Oiu 
OOOOOOOOOOOOOOOOOOwwww-1 — w 
OOOOOOOOOOOOOOOOOOOOOOOOO 
OOOOOOOOOOOOOOOOOOOOOOOOO 


Page 46 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 21 


56 




dr dobbs journal of 

COMPUTER 

(Calisthenics Orthodontia 

Running Light Without Overbyte 

Number 22 February 1978 Volume 3, Issue 2 

A REFERENCE JOURNAL FOR USERS OF HOME COMPUTERS 


ET TU, KLATU?, Stanford News Service 4 

Quasar Industries’robot called “a fraud” by John McCarthy 

The Last Rehash of Beau Hex? letters in the unending/?) hex/octal debate 45 

6502 SOFTWARE 

Decoding Efficiency & Speed: Pros & Cons of Table Look-up, H.T. Gordon 5 

8080 & Z-80 SOFTWARE 

MITS 4.0/4.1 BASIC Searcher/Patcher, James Monagan 8 

Z-80 RAM Tester, John MacDougall 42 

Mini Editor for 8080 PILOT, Tim Scully 43 

CODE RELOCATION 

A Simple Technique for Static Relocation of Absolute Machine Code, Gary A. Kildall 10 

the creator of PL/M and CP/M tells how 

Relocation is Not Just Moving Programs, Richard L. Roth 14 

TV DAZZLER SOFTWARE 

PCC’s Dazzler Contest Winners (at long, long last), Robert B. Jacobsen, Exec. Dir., PCC 21 

Absolutely Dazzling Dazzleware, Gordon French & Gregory Yob 22 

Dazzler Driver Subroutine and a “Chase”, Phillip Simpson 30 







MORE GOOD ADVICE ON MAIL ORDERING 

Gentlemen: Received: 78 Jan 24 

In regard to your recent article on slow or non-existent 
delivery on the part of some merchandisers in the home com¬ 
puter field, I’ve devised some defensive techniques that work 
well. 

Always write a letter in advance asking if the product is 
available for immediate delivery provided that a certified 
check or money order is sent. 

If you receive no reply, don’t send in an order. If you are 
really anxious to purchase the product, you might try a 
follow-up letter just in case the first one got lost somewhere 
along the way. If you still hear nothing, forget it. 

Once you have received a letter indicating that the product 
is available, send in your order with certified check or money 
order. Keep a copy of the dated letter and also photocopy the 
check. In your cover letter clearly state that you wish ship¬ 
ment within 2 weeks (or whatever time you feel is reasonable). 
Otherwise you want your money refunded. 

If you do not receive the product on time, send a follow¬ 
up letter. Courteously remind the merchandiser that shipment 
by a certain date had been promised, and refer to your 
previous correspondence by date. Keep a copy of this letter 
also. 

If you do not receive a reply within two, weeks, send a not- 
so-courteous letter by certified mail, return receipt requested 
(costs about a dollar). Tell the supplier that you want an 
immediate refund or you will report the matter to the U.S. 
Postal Service, the Attorney General of your state, and to the 
magazine in which the advertisement appeared. Keep a number 
of copies of this letter, along with the signed delivery receipt. 

Wait another two weeks, and, if you still have not received 
the product or a refund, proceed to report the matter to the 
U.S. Postal Service, Attorney General, etc. Send copies of 
correspondence with the merchandiser. Send the merchandiser 
copies of your complaint letters. You might also send copies 
to the Better Business Bureau in the merchandiser’s home 
town. 

If the above sounds like it was written by a paranoid, I can 
only claim long and bitter experience. My method works so 
long as the supplier is not an out and out fraud. Before sending 
a really substantial check, I would ask the supplier for credit 
references, if I was at all dubious. 

It is also extremely effective to send complaints to the 
supplier’s bank (appears on the back of the cancelled check 
if deposited) and to credit rating bureaus, as well as the whole¬ 
salers he deals with, if known. These are effective measures in 
drastic cases. 

Sincerely, Berme Rd 

John D. Hirsch Kerhonkson, NY 12446 


RASKIN JOINS APPLE: LEAVES DR. DOBB'S 

Announcement Dated: 78 Jan 18 

Jef Raskin has been our itenerant product evaluator for 
some time. Part of the reason he could do that is that he was 
an independent (very) computer consultant. He has recently 
taken a position as Director of Publications with Apple Com¬ 
puters of Cupertino, California. As such, he can no longer be 
considered to be “independent.” Therefore, he will no longer 
be submitting “product evaluations” to DDJ. It is likely, 
however, that we will—from time to time—publish “product 
opinions” authored by Jef. 


O TEMPORA, O MORES! 

Vector Graphic Inc. 

790 Hampshire Road, A-B 
Westlake Village, CA 91361 

Dear Vector Received: 78 Jan 30 

You are without a doubt the most sneaky, conniving com¬ 
pany I have had to deal with in the microprocessor field. It is 
disgusting. 

My letter to you, written (and clearly dated!) 22 January, 
1978 (a Sunday) was not mailed until 23 January 1978. Yet 
you managed to somehow get ahold of it on the 24th and get 
your reply into my hands by 2 PM on the 25th, a gap of al¬ 
most 4 whole days! What’s more, the material promised by 
you did not arrive until the 26th, 2 whole days later, which 
was exactly as promised! 

Now my request was fairly reasonable and should have been 
simple to answer. But oh no! you have to set someone down 
who completely understood my request, have them answer my 
letter specifically point by point and then cause them to mail 
the answer without cramming the envelope with useless and 
unrequested literature. 

Well let me tell you people up there at Vector that while I 
may have appeared to be a mild mannered computer hobbyist 
working for a Great Metropolitan Newspaper, I am in fact, a 
systems analyst with more than 20 years experience in all as¬ 
pects of data processing... And I’m not going to stand still for 
conduct like yours! 

If I can write to MITS, Micropolis, Digital Group and Dyna- 
Byte and never receive any reply at all, and if IMSAI and Poly 
Morphic and Space Byte need from thirty to ninety days to 
get a bale of unwanted literature to me instead of an answer to 
a specific question, then the obvious question to me is 
WHAT’S WRONG WITH YOU PEOPLE UP THERE? 

Don’t you people realize that a response like I received is 
like waving a yellow flag in front of a gorilla? You may think 
you have the world by the toe-nails and can afford to trifle 
with guys like me but you’ve made a serious mistake this time. 
I’m really going to give you the business! 

A copy of this letter is going directly to Tom Williams at 
Dr. Dobb’s Journal. There is no doubt in my mind that Tom 
will publish the letter and let everyone know just what kind of 
shenanigans you guys are up to! 

Acryptically yours 
Robert S. Hoover 

First Heath returns phone calls, now Vector Graphic answers 
letters. What is this world coming to? -TRW 


SOLUS PREPARES SOFTWARE DIRECTORY 

News Release 78: Jan 29 

The SOL Users’ Society (SOLUS) is preparing a directory 
of programs that are tailored to run under the SOLOS and 
CUTER operating systems. The list will be published in the 
SOLUS Newsletter (at no charge to the software vendors). 

To qualify for listing in the directory, a program must be 
compatible with both SOLOS and CUTER and be available on 
CUTS format or Kansas City standard cassettes. It must be 
well-documented for the user, extensively tested and 
debugged, and supported by a warranty to repair or replace for 
at least 3 months. Programs written in higher-level languages 
will be accepted if the interpreter meets these specifications. 

Software vendors should send a brief description and order¬ 
ing information to SOLUS NEWS, Box 23471, San Jose, CA 
95153. 


Number 22 Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 Page 3 


59 


ET TU, KLATU? 

Stanford University News Release Received: 77 Nov 14 

A company which claims it is ready to manufacture and sell 
truly intelligent household androids, or robots, within the next 
two years—to the tune of $4,000 apiece—has the nation’s 
artificial intelligence experts up in arms. The experts 
unanimously state that the claims are fraudulent. The com¬ 
pany, Quasar Industries located in Rutherford, NJ, is currently 
touring shopping centers around the country with a model of 
an android which they claim comprehends 4,000 words of 
vocabulary and can vacuum, wash dishes, and teach the kids 
French. Crowds in the sundry department stores are dazzled, 
according to numerous press reports. This robot is a fake, 
according to scientists from Carnegie-Mellon University in 
Pittsburgh, PA. The scientists recently undetook a first-hand 
investigation of the matter and found the robot to be a 
“radio-controlled puppet.” 

Quasar Industries sees it differently. “We programmed the 
robot to approximate human behavior,” said Anthony 
Reichelt, president of the company. “The only limitations to 
what it can do is the boundary of imigination and the cost 
factor.” Quasar Industries has no relationship with a brand of 
television set formerly manufactured by Motorola and now 
made by a Japanese company. 

Numerous publications, including Newsweek, Parade, and 
Newsday, have in recent months printed articles about the 
robot—called Sam Strugglegear—in which the claims made by 
Quasar Industries are reported as fact. “It is a fraud that has 
gone on far too long,” says John McCarthy, director of 
Stanford University’s Artificial Intelligence Laboratory. 
McCarthy is one of the earliest pioneers in the field. The 
technology is nowhere near being able to manufacture a 
robot which can do all, let alone safely, what Strugglegear’s 
owners say it can do, McCarthy said in an interview. The 
company has some sort of expensive, remote-controlled 
gimmick, he said, which in no way possesses the sort of 
intelligence claimed for it. “The press has been extra¬ 
ordinarily irresponsible in not bothering to ask the opinion 
of artificial intelligence experts on the matter. They don’t 
have to believe us, but they should at least ask.” On Oct. 24, 
according to Carnegie-Mellon graduate students Brian Reid 
and Mark Gos, a well-known department store in the heart 
of Pittsburgh advertised the appearance of a “domestic 
robot.” “Knowing of CMU’s pioneering work, particularly 
in the field of speech recognition, various friends called 
CMU to ask how this robot might be so much better at 
speech recognition than our talented and dedicated research 
teams,” they wrote in a memorandum sent to colleagues at 
Stanford, MIT, and elsewhere. “Rising to the challenge, four 
courageous members of our department went downtown to 
investigate. They found a frightening sight: in the men’s 
department, among the three-piece suits, was a 5’ 2” image 
of an aerosol can on wheels, talking animatedly to the 
crowd.” 

Upon closer investigation, the CMU experts saw that the 
robot was surprisingly crude. “It didn’t seem able to tell that 
an object was blocking its path. Covering the faceplate did not 
change its behavior at all. Since the robot seemed able to 
navigate around the room without hitting anything, we found 
it quite curious that it had no detectable sensory reactions. 
Feeling more dubious, we began to look around the room for 
evidence of remote control. Lo and behold, about 10 feet 
from the robot, standing in the crowd, we found a man in a 
blue suit with his hand held contemplatively to his mouth. 
After watching for a while we noticed that whenever the robot 
was talking, the man in the blue suit could be seen muttering 
into his hand.” 

At a second store, “they found a furtive-looking and rather 
disagreeable person loitering in the back of the room. He was 

Page 4 


carrying an airline flight bag with his hand stuck down in the 
bag.” The investigators challenged the man, suspecting that he 
was controlling the movements of Sam Strugglegear. The man 
became “very excited and called for store officials to come get 
us away from him,” the CMU scientists said. Quasar Industries 
still maintains they will be ready to market a domestic robot 
within 18 to 22 months. It will, they said, be able to perform 
12 household tasks such as “serve your dinner, vacuum your 
rugs, babysit for your kids, and insult your enemies.” Such 
claims amuse, annoy, and sometimes downright anger artificial 
intelligence experts. 

Stanford graduate student Paul Martin, who is writing a 
thesis on the problems of machines understanding natural 
dialogue, believes much of the gullibility on behalf of the 
public, the press, and department store managers stems from 
recent technological innovations, such as hand-held calculators 
and space missions. But there is a huge difference, Martin said, 
between having a machine which can recognize separate, 
simple words (this is possible now) and one that can under¬ 
stand the flow of language as spoken naturally. “Everyone in 
the field would agree there are important scientific problems 
waiting to be solved before we can get to the real thing. On 
how long these problems will take to solve, you find a diver¬ 
sity of opinion. I tend to hedge by saying it will take between 
five and 500 years. If you ask me to center it, I would say 40 
years. The basic problems are how to make computers 
recognize patterns in a noisy environment and how to go 
about representing common sense knowledge about the world, 
how to put that in a computer. In fact, what common sense 
knowledge about the world is there? How can a machine be 
taught to solve problems? 

“One way these problems express themselves is in safety 
issues. A household robot has to be very reliable, mechanically 
and intellectually. It must distinguish between children and 
animals as objects. It cannot think the baby is part of a stack 
of pillows. It has to have a wide knowledge of different kinds 
of objects to be intelligent.” In response to a reporter’s ques¬ 
tion whether the robot could tell a cup from a saucer, Reichelt 
responded that it didn’t have to because it didn’t take them 
off the tray. McCarthy then argued that, in that case, the 
Quasar robot is too limited to be really useful. “Say it could 
carry a dinner tray from the kitchen to the dining room,” 

McCarthy said. “Someone in the kitchen would have to pre¬ 
pare the tray. The robot would be on a tread, according to the 
company. But it still couldn’t be done safely. It could trip 
on a rug. It could run over something. It could fall down the 
stairs.” 

Sam Strugglegear, also called KLATU in some news reports, 
is not yet out of the news. A few weeks ago, while performing 
at a shopping center in Philadelphia, the imitation robot 
reportedly frightened a 10-month-old child. The child’s « 

mother has filed suit for $100,000 in damages, saying that the 
robot “accosted, touched, assaulted, and terrorized” her child. 

The CMU scientists were reminded by these recent events 
of another famous “intelligent” robot build by Baron 
Wolfgang van Kempeler in 1769. This robot, known as “the 
Turk,” would trounce people at chess, all while rolling its eyes 
and nodding its head. Thousands of people, including Edgar 
Allen Poe and Napoleon, examined it thoroughly and could 
not figure out how it worked. It wasn’t until more than 70 
years later that the truth was discovered. The robot cleverly 
concealed a dwarf who was a talented chess player. Kempeler’s 
description of his own robot, circa 1771, the CMU investigat¬ 
ors said, is probably the best summary of Sam Strugglegear: 

“A mere bagatelle, not without merit in point of mechanism, 
but whose effects appear marvelous only from the boldness 
of conception and the clever choice of methods adopted for 
promoting the illusion.” 

Number 22 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


60 


Decoding Efficiency & Speed; 

Pros & Cons of Table Look-Up 


BYH.T. GORDON 

College of Agricultural Sciences 
University of California 
Berkeley, CA 94720 

Dear Jim, Received: 78 Jan 15 

While some of your readers may have become as weary as 
lam with my repeated attacks on the 650X legality-bytecount 
problem, this is in a way a programming guinea-pig for 
working-out optimization principles, relevant to all problems. 
Even your non-650X readers may find something of value in 
the enclosed MS, as it touches on some universal problems: the 
chioce between decoding-logic or table-look-up programs, the 
extent to which subroutines should be designed to be non¬ 
destructive and purely-informative, and the uses of antibug¬ 
ging code. My ultimate goal is to develop scanning-debugging 
to a higher level. For this, the basic components of the 
debugger must be fast, efficient, and above al bug- free. 
Sincerely, 

H. T. Gordon 

The question of how to optimize a decoding subroutine, 
previously touched on in my notes in issues #17 and #19 
of DDJ (1977) using decoding of the number of bytes 
required by 650X opcodes as an example, is re-opened by 2 
new solutions: CNTBYT (written by Jim Butterfield and 
reproduced here with his permission) and BYTCNT (my 
own response to his challenge). Both optimize coding 
efficiency, and it is unlikely that a solution in fewer than 
28 bytes exists. Both sort the 151 legal opcodes into the 
same 6 groups as my earlier subroutine BYTNUM. However, 
CNTBYT classes illegals of type X 0 B as 3 byte codes while 
the others class them as 2 byte codes (which is how the 
650X control unit executes them, but this is immaterial 
since all routines class illegals of type X2 as 2 byte codes 
although most of them are not executable). 

The important differences are in structure and timing. 
CNTBYT uses an elegant and highly instructive linear sequence 
of bit-manipluations that cause each of 5 classes of opcodes 
in turn to become zero and exit, while the 6th class exits as 
non-zero. BYTCNT emulates BYTNUM by first sorting into 
subclasses X(0-7) and X(8-F) by a BIT test of bit 3, then 
shifts to destructive logic in each branch to attain higher 
code efficiency. Unlike BYTNUM, both new routines destroy 
the accumulator. 

All routines have different path lengths (measured in 
clock cycles from entry to exit, including the 6 cycles for the 
main program JSR and 6 cycles for the RTS) for each of the 
6 opcode classes. An index of relative speed (not weighted 
for difference in opcode usage frequency) is easily calculated 
by dividing 2 (N X T) by £ N, where N is the number of 
legal opcodes in a class and T the path length in cycles for 
that class. BYTNUM has the fastest index, 30.6 cycles (range 
28 to 37). BYTCNT is slower, 32.5 cycles (range 29 to 39). 
CNTBYT is slower still, 39.3 cycles (range 23 to 42). The 
delay is caused by its having to sort out 3 small classes (con¬ 
taining only 11 of the 151 opcodes) before it can work on the 
3 large ones. The lesson to be drawn from this is that linear- 
sequence logic is not inherently slower (as I implied in my 
previous DDJ notes) and might even be faster if its first 
stages could sift out the majority of the items being sorted. 


However, the range of sorting times is necessarily wider. 
One additional point: to make the 2 new routines fully equiva¬ 
lent to BYTNUM, one would have' to add a PHA to store and 
a PLA to restore the accumulator, at the cost of 2 more bytes 
and 7 more cycles. However, the main program might be 
able to restore the accumulator more efficiently. 

One interesting point about all these “decoding” routines 
is that, although their branch instructions subdivide opcodes 
into 6 classes, they return with 3 byte-count classes 
re-encoded (as 01, 02, and 03) in the X register, so that a 
little more decoding logic is required to use this information. 
A second point, that 1 have emphasized before but that 
deserves reiteration, is that they all produce additional 
information as an incidental effect. E.g., CNTBYT and 
BYTCNT cause only 1 byte opcodes to set the Z flag, i.e., 
this type is truly decoded. It would be easy to recode 
BYTNUM to have the same effect, by omitting its inner RTS 
and relocating its TRICK sequence outside the subroutine. 
This would save 1 byte and very slightly reduce its speed. 
CNTBYT returns with the carry flag always equal to bit 7 
of the opcode, and the sign flag always cleared. BYTCNT 
sets the carry flag equal to bit 4 for all 1 byte opcodes; it 
clears the carry for opcodes of type (0,1) (0,7) and sets it 
for all others. The BIT instruction in BYTCNT and BYTNUM 
sets the V flag equal to bit 6 for all opcodes; in BYTNUM it 
also causes all 1 -byte opcodes to return with the N flag equal 
to bit 7. 

I still prefer and recommend BYTNUM, although in my 
KIM system it takes 32 bytes (that would be 31 in the minor 
revision suggested above). In a well designed system, every 
one of the 256 possible bit patterns would be present in 
ROM (for use as numerical constants, BIT masks, etc.) and 
BYTNUM could be coded in 30 (or 29) bytes, a small price 
to pay for non-destructive logic and higher speed. 
Unfortunately (as I showed in a recent note in Kim User Notes) 
the KIM-ROM omits 81 of the possible patterns, including 
39 of the 151 legal opcodes. 

In the letter in which Jim Butterfield sent me his CNTBYT 
program, he also pointed out that a table-look-up operation 
would optimize timing. One way to do this is to move the 
opcode into an index register to get the content of a unique 
location in a 256 byte table. A content of 00 would identify 
an illegal (setting the Z flag), while contents of 01, 02, or 03 
would give the byte-count of a legal. A 7 byte program insert 
(XINFOA, cf. listing) would do the work of both BYTNUM 
and OPLEGL at a cost of (7+M) main program bytes and 
(10+N) cycles. The values of M and N depend on whether the 
opcode needs to be restored in the accumulator (if not, both 
are zero) and on the kind of coding the main program is using 
to pick up a sequence of opcode bytes (most likely the LDA 
(INDIRECT), Y instruction with M = 2 and N = 5). Since 
the existing (not optimized) decoding logic version of 
OPLEGL needs 66 subroutine bytes and has a speed index of 
37 cycles (range 24 to 63), the XINFOA insert would run 
more than 4 times faster than the OPLEGL + BYTNUM 
combination. To anyone enamored of speed (as I am) this 
is very attractive. An added superiority is that the main 
program can decide what to do with an illegal. If a program 
BREAK is desired, the branch offset ILLEG can be directed 
to the nearest 00 operand, otherwise to an illegality handling 
routine. One of several flaws in OPLEGL is that it forces a 


Number 22 


Dr. Dobb’s Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 5 

61 



BREAK for illegals. A well designed subroutine should return 
information and not make decisions. 

Nothing comes free, and the price of the XINFOA speed 
is a very long table, with every opcode a unique class, 
vulnerable to bugs if located in RAM. Ideally an info table 
like TAB256 should be in ROM, but it uses only the 2 low- 
order bits and one hesitates to waste 75% of the bits in an 
expensive ROM. The solution would be to encode other 
information in the high-order bits, and AND them out to 
retrieve the legality/bytecount data. The dilemma is: what 
other information? 

I briefly explored another approach, fully packing the 
infobit pairs of TAB256 into a 64 byte table. Retrieval needs 
a 36 byte program, too long for a main progarm insert, and 
with a speed index of 63 cycles when made into a subroutine. 
This is not good enough to be worth presenting here. 

A more promising use of info tabling is my new legality- 
testing subroutine, HYLEGL, that has many advantages 
when compared with OPLEGL. It needs only 64 bytes, saves 
and restores the accumulator, and returns with the carry 
flag set by illegals and cleared by legals. Its speed index is 
44 cycles (range 36 to 71). A revision of OPLEGL to make 
it fully equal to HYLEGL would be about 10 bytes longer 
and 2 cycles slower. 

HYLEGL is a “hybrid” operation that retains the decoding 
logic of OPLEGL for the 128 “odd-number” opcodes because 
this is both fast and efficient. For the 128 “evens” it encodes 
legality as single infobits packed in a 16 byte table, INFTAB, a 
1 bit meaning illegal and a 0 bit legal. A table-addressing index 
from 0 to F is generated by ANDing bits 4321 of the opcode, 
bit 0 (always 0 for evens) having been right-shifted out. The 
16 infobytes correspond to the original opcode sequence: 
X 0 0, X 0 2,. .. .X 0 E, X,0. .. .X,E. Since 7 of the infobytes 
contain no 1 bits, legality is proved by the setting of the Z 
flag at the load into the accumulator, so no retrieval is needed. 
For the remaining 9, the correct infobit is moved into the 
carry flag by a sequence of from 1 to 8 ASLs, controlled by 
analyzing the status of bits 765 of the original opcode (stored 
in the temporary zero-page location COPY). 

Since INFTAB contains 128 unique classes, it is as 
vulnerable to bugs as any other table in RAM. Since it is short, 
it is much easier to,check and also more likely to get itself 
fitted into a ROM. Decoding logic in RAM is of course not 
immune to bugs, but when a large class is involved the bug 
will show up very quickly. In a unique class, rarely use-tested 
(such as the illegals individually weeded out by OPLEGL) 
a bit-error bug may lurk for a long time before inflicting 
damage. Worse, the damage may be neither suspected nor 
detected; the output will look right but be wrong, and may 
even create a new hidden bug in other programs. 

HYLEGL highlights some “gray areas” of subroutine 
design, where programming philosophies differ. The X 
register is used in its table look-up segment, but the pre-call 
X content is saved and restored at a cost of 4 bytes and 6 
cycles. Its operations destroy the pre-call content of the 
accumulator, but this is saved and restored at a cost of 3 bytes 
and 7 cycles. It can be argued that only the main program 
really knows what needs to be saved and how and where to 
save it and when to restore it. By omitting the saves, HYLEGL 
would need only 57 bytes and 34 cycles, but greater pre¬ 
caution would be needed in the writing of the main program 
(perhaps not an evil). Should subroutines try to leave no 
traces of their work, other than the intended ones? Despite 
its saves, HYLEGL does leave traces, in the zero-page 
locations STORX and COPY and as incidental effects on the 
N, Z, and V flags. However, the PLP and PHP instructions 
of the 650X make status saving especially easy for the main 
program, and low zero-page locations are commonly viewed 


as temporary scratchpad area. My current view is that sub¬ 
routines should be written to save on-chip registers, since it 
is easy for a user to remove any save instructions he does 
not want. 

In order to make the high speed of the XINFOA/TAB256 
approach immediately available, I am adding to the package 
subroutine MKTABL, that uses HYLEGL and BYTNUM to 
construct a temporary TAB256 in a RAM page. MKTABL 
is long (52 bytes) because it has an unusually high content of 
antibugging code and also serves as a testing/debugging 
program for the legality/bytecount subroutines. A large table 
in RAM is not only insecure but hazardous to generate. The 
data generating routines may be yielding some incorrect 
values. The write operation may be overwriting a RAM page 
other than the intended one, or trying to write in nonexistent 
RAM (that in systems not fully address-decoded may prove 
to be existent RAM with valuable stuff in it) or in write- 
protected RAM or in ROM. 

Before calling MKTABL, a main program is expected to 
write into location BASEHI the number of the RAM page into 
which the table will be written. MKTABL compares this to 
the unique page number in its own coding; only if they are the 
same will table writing be permitted. It also sets the low base 
address for the table to 00, to ensure that the table will lie 
within the bounds of the one RAM page. This is part of the 
initial zeroing of 5 adjacent zero-page locations, that will 
contain useful information when MKTABL exits. The lowest 
one, COPY, is used by HYLEGL and will contain $FF at a 
correct exit; each run of HYLEGL stores the opcode it has 
worked on, unaltered except for the 72 “evens” that require 
infobit retrieval (that causes one ASL of COPY). 

The next higher location (LEGCNT) contains $97 at a 
correct exit, since this counter is incremented before each 
call to BYTNUM, of which there will be 151 if HYLEGL is 
working properly. The next location (CHKLO) is a 1 byte 
checksum that contains $41 at a correct exit. The next 
location (TABGEN) indirectly counts the number of table- 
writes, containing either 00 (if no table was written) or $FF. 
This is a bit trickier than a simple count. After each write, 
the current value of the opcode is moved from the Y index 
into the accumulator, destroying the infobyte content so that 
the subsequent reloading of the infobyte from the table 
location is a test that the correct value was indeed stored 

there. The actual content of TABGEN is the current opcode 
value, from Y, that if all is well is also the count of writes. 

Finally, the content of BASELO should always be 00, 
and BASEHI should contain the number of the unique permis¬ 
sible RAM page if the main program commanded a table- 
write, and some other number if not. A simple way to imple¬ 
ment a no-table command would be an LDY #$06 followed 
by a JSR SETEX to bypass the first MKTABL instruction, 
since SETEX would zero BASEHI. 

The terminal instructions of MKTABL control the 2 flags 
that will tell the main program what has happened. The BIT 
sets the V flag if a table has been written (TABGEN = $FF), 
and clears it if not. The crucial instructions compare the 
checksum in CHKLO with the correct value $41, setting the 
Z flag if all is well, clearing it if not. A great variety of errors, 
either in MKTABL itself or in the subroutines it calls, can 
cause a wrong checksum. Much information on the kind of 
error can be derived from the content of the 6 zero-page 
locations, of the accumulator (should be $41) and of the 
X and Y registers (both should be 00). If a table was written, 
very detailed information on operation will be found in the 
infobyte sequence. 

The antibugging logic in MKTABL, although far from a 
total bugproofing, is clearly costly in memory and time. 
Programs that aim to optimize timing, such as the XINFOA/ 


Page 6 Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 Number 22 


62 



TAB256 combination, can tolerate little or none. (An example 
of very light antibugging would be addition of an AND #$03, 
at a cost of 2 bytes and 2 cycles, to erase the 6 high-order 
bits of the infobyte.) The major insurace against error for 
such programs is a thorough testing by an antibug test 
program, both before and after each use. In service programs 
resident in RAM, like MKTABL, error-proofing can be given 
priority. It may be desirable to trade off more memory to 
attain higher speed, but one should never trade off reliability! 
On this subject, the chapters on antibugging, testing, and 
debugging in E. Yourdon’s Techniques of Program Structure 
and Design (Prentice-Hall, 1975) make interesting reading. 

To sum up, tables can indeed play useful roles beyond 
their classic one of defining arbitrary relations and rules 
(such as the metalogical ASCII decision that $41 represents 
the letter A). These other roles have been obscured by the fact 
that it is simpler to implement a de novo calculation of a math 
function than a look-up in a gigantic table. With tables of 
more modest size, table look-up can (as Jim Butterfield 
suggested) maximize speed, at an acceptable (though relatively 
high) memory cost. When decoding logic proves to be very 
intricate (many small or unique classes) the use of tables may 
also be more code-efficient. Furthermore, programs may be 
easier to write because similar retrieval logic may be applicable 
to a variety of tables. There is probably some trade-off point 
(more that 35 bytes of decoding logic, more than 10 classes 
decoded?) where the entabling of pre-decoded information 
becomes an optimal solution of the dimensions of the table 
can be kept within reasonable bounds (no more than 32 
bytes?). 


0230 

2 

i 

8 

A 

B 

D 

F 

021+1 

3 

5 

7 

9 

A 

024B 


(coding Tor CNTBYT and BYTCNT) 


A2 01 

49 20 

F0 13 

29 9F 

F0 11 

0A 

49 12 

F0 0B 

CNTBYT 

29 1A 

49 02 

F0 06 

29 10 


D0 01 

E8 

THREE 

E8 

TWO 

60 

ONE 


LDX #$01 (initialize X) 
EOR #$20 (flip bit 5) 

BEQ THREE (only $20) 

AND #$9F (bits 5,6 out) 
BEQ ONE (only (0,4,6)0) 
ASL A (shift bit 7 out) 
EOR #$12 (flip bits 3,0)* 
BEQ TWO (only X Q 9) 

AND #$1A (bits 4,1 out)* 
EOR #$02 (flip bit 0)* 
BEQ ONE (X(8,A)> 

AND #$10 (all but flipped 
bit 3 out)* 
BNE TWO (resid. X(0-7)) 
INX (resid, X(9-F)) 
INX 
RTS 


* comment refers to original opcode bits 
before left-shift at 023A 


0230 

A2 

01 

BYTCNT 

LDX #$01 

2 

2C 

36 02 


BIT BYTCNT+6 (test bit 

5 

D0 

08 


BNE HALFOP (all X(8-F)! 

7 

C9 

20 


CMP #$20 

9 

F0 

0E 


BEQ THREE (only $20) 

B 

29 

9F 


AND #$9F (bits 5,6 oul 

D 

D0 

0B 


BNE TWO (all except 

(0,4,6)0) 

F 

29 

15 

HALFOP 

AND #$15 (retains only 
bits 0,2,4) 

0241 

C9 

01 


CMP #$01 

3 

F0 

05 


BEQ TWO (X (9,B)) 

AND #$05 (bit 4 out) 

5 

29 

05 


7 

F0 

02 


BEQ ONE (X(8,A) and 
(0,4,6)0) 

9 

E8 


THREE 

INX (resid. X(9-F)) 

A 

E8 


TWO 

INX 

024B 

60 


ONE 

RTS 


X1NF0A TAX 

LDA TAB256, X 
BEQ ILLEG 
TAX 


026E 

48 

HYLEGL PHA 

(save opcode in stack) 

F 

% 

10 

STA 

COPY (store work-copy) 

0271 

4a 


LSR 

A (bit 0 to carry) 

2 

90 

0A 

BCC 

TABLOP (do evens/table) 

k 

4A 


LSR 

A (bit 1 to carry) 

5 

B0 

05 

BCS 

ILLEX (all X(3,7,B,F)) 

7 

C9 

22 

CMP #$22 (LSRed $89) 

9 

F0 

01 

BEQ 

ILLEX ($89 illegal) 

B 

18 


CLC 

(legals clear carry) 

C 

68 

ILLEX PLA 

(restore opcode in A) 

D 

60 


RTS 


E 

86 

0F TABLOP STX 

STORX (save X register) 

0280 

29 

0F 

AND #$0F (bits 7,6,5 out) 

2 

AA 


TAX 

(4321 to X index) 

3 

BD 

9E 02 

LDA 

INFTAB,X (load infobyte) 

6 

F0 

12 

BEQ 

EXIT (all 0 bits, legal) 

8 

06 

10 

ASL 

COPY (bit 7 to carry) 

A 

B0 

04 

BCS 

STEPA (bit 7=1) 

C 

0A 


ASL 

A (leftshift infobyte) 

D 

0A 


ASL 

A 

E 

0A 


ASL 

A 

F 

0A 


ASL 

A 

0290 

24 

10 STEPA BIT 

COPY (bits 6,5 to N,V) 

2 

30 

02 

BMI 

STEPB (bit 6=1) 

4 

0A 


ASL 

A 

5 

0A 


ASL 

A 

6 

70 

01 STEPB BVS 

STEPC (bit 5=1) 

8 

0A 


ASL 

A 

9 

0A 

STEPC ASL 

A (infobit to carry) 

A 

A6 

0F 

EXIT LDX 

STORX (restore X) 

C 

68 


PLA 

(restore opcode) 

029D 

60 


RTS 



INFTAB table for even opcodes 

029E 10 DF 0D 00 00 00 01 00 
02A6 00 FF CF 00 00 OF DF 10 


(coding for MKTABL) 


02AF 

02B1 

3 


8 

9 

A 

D 

F 

02C1 

3 

6 

7 

9 

B 

D 

F 

02D0 

2 

k 

5 

7 

9 

A 

C 

E 

02E0 

02E2 


A0 05 
A2 00 
96 0F 
88 

D0 FB 

D8 

98 

20 6E 02 
A2 00 
B0 05 
E6 11 
20 10 02 
8a 

A2 XX 

e4 15 


D0 07 
91 14 
98 


ii 


65 

B1 
18 
65 12 
85 12 
c8 

D0 DD 


24 13 
A9 41 
c5 12 
60 


MKTABL LDY #$05 (zero 5 loci) 

SETEX LDX #$00 (notable entry) 
ZEROIT STX COPY-1, Y 
DEY 

BNE ZEROIT 

CLD (clear decimal mode) 
OPBYTE TYA (opcode from Y to A) 

JSR HYLEGL (test legality) 
LDX #$00 (rezeroes X) 

BCS MOVXA (illegal bypass) 
INC LEGCNT (count legals) 

JSR BYTNUM (bytecount to X) 
MOVXA TXA (bytecount from X to A) 
LDX #$XX (RAM table page #) 
CPX BASEHI (compare page # 
set by program) 
BNE NOTABL (nowrite if #) 

STA (BASELO),Y (write) 

TYA (opcode from Y to A) 

STA TABGEN (count writes) 

LDA (BASELO),Y (read table) 
NOTABL CLC (clear carry for add) 
ADC CHKLO (bytecount sum) 

STA CHKLO (store checksum) 
INY (next opcode ) 

BNE OPBYTE 

EXIT BIT TABGEN (sets V if table) 
LDA #$41 (valid checksum) 

CMP CHKLO (compare actual) 
RTS 


I 


Number 22 


Dr. Dobb’s Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 7 

63 




BASIC SEARCHER/PATCHER 

Dear Dr. Dobb’s: Received: 77 Dec 9 

The enclosed program should be of use to anyone seeking 
to modify MITS 4.0 or 4.1 BASIC. It should be used with 
an 8080 disassembler such as the one published in the March 
1977 issue of Dr. Dobb’s Journal. 

The program has two functions; viz., searching and 
patching. The code to be searched or patched may reside 
anywhere in memory or on the reserved areas of the disk. 
These areas comprise the first five tracks and are occupied 
by the bootstrap/loader (sectors # 0,2,4,6) and by BASIC 
itself (remaining 156 sectors). 

The search function accepts any non-empty string of 
characters or hexadecimal digits. A search is then performed 
over the specified address range. Wherever a matching string 
is found, the hex address is displayed or printed and the 
search continued. 

Two searching examples are given. In the first, the memory 


resident BASIC code is searched for all occurrences of the 
hex string ‘DB08’ (read disk status command). These indicate 
where the disk I/O routines are located. In the second 
example, a search is made through part of the BASIC code 
on the disk for the string “RANDOM”. This was found only 
once in the specified address range. 

The patch function accepts a starting address, which is then 
displayed together with the hexadecimal, decimal, and ASCII 
equivalents of its contents. If the byte is to be changed then 
a single character or two hex digits are entered. Otherwise 
only a carriage return is entered. The patching address is 
then incremented, decremented, or left unchanged, as selected. 

Two patching examples are shown. In the first, the string 
“RANDOM” beginning at address ‘069D’ is changed to 
“RANCID”. In the second, the command ‘DB08’ (IN 08) 
at ‘2E86’ is changed to D309’ (OUT 09). Since these changes 
were made only to memory, they are not permanent. 

James Monagan 806 Clark St. 

Iowa City, IA 52440 


10 PRINT"'PATCHER" 12/05/77 

20 PRINT"PATCHES ANV BYTE IN MEMORY OR ON THE DISK COPIES OF MITS 4 0 B 
ASIC AND BASIC BOOTSTRAP/LOADER " 

20 PRINT"ALSO SEARCHES THROUGH ANY OF THE ABOVE TO LOCATE A GIVEN ASCII 
OR BINARY STRING " 

40 CLEAR500 
50 TRK=-1 
60 ' 

70 PRINT . INPUT"1> SEARCH 2> PATCH"; FC: IFFCC1ORFO2THEN70 
80 PRINT:MEM=1 INPUT"1> MEMORY 2) BOOTSTRAP 3> BASIC"•MEM IFMEMCIORM 
EM>3THEN80 
90 IFFC=2THEN 980 
100 

110 SEARCH ROUTINES 

120 PRINT:INPUT"DO YOU WANT HARD COPV";ZZ* PRINT 
130 IF LEFT*<ZZ*. 1>-"V" THEN HDCPY=1ELSEHDCPV=0 
140 

150 GOSUB400 ' GET START ADDRESS 
160 PC=X 

170 PROMT*-"END"GOSUB420 GET END ADDRESS 

180 HLTADR-X 
190 GOSUB490 CHECK IT 
200 

210 PRINT 1-3:INPUT"±> CHARACTER- 2> HEX-STRING SEARCH 3> EXIT"; I IFI 
=3THEN70 

220 LINE INPUT"SEARCH STRING * "; SRCH* IFHDCPYTHENGOSUB65520 
230 PRINT PRINT"SEARCH STRING = ", IFI—2THENPRINT"HEX "; 

240 PRINT" •'"SRCH*" " 

250 PRINT"ADDRESS" 

260 IFI-2THENGOSUB870 CONVERT STRING IF HEX 

270 SLG»LEN<SRCH*>:IFSLG-0THEN G0SUB65525 GOTO210 INVALID STRING' 1 

280 BCX-1:SS-ASC <SRCH* > ' 1ST BYTE 1ST 

290 

300 SEARCH FOR STRING 

310 IFMEM=1THENX-PEEK(PC)ELSEGOSUB690 ' FETCH NEXT BYTE 
320 PC-PC+1 IFXOSSTHEN350 MATCH ? 

330 IFBCXCSLGTHEN BCX-BCX+1:SS»ASC<MID*<SRCH*>BCJO > GOTO360 C OMPARE F 
OLLOWING BYTE- IF ANV 

240 X=PC-SLG.GOSUB610:PRINT ' FOUND, PRINT ADDRESS 
350 IFBCX>1THENPC«PC-BCX+1 BCX-1 SS=ASC<SRCH*> 

360 IFPCCHLTADRTHEN310 
370 G0SUB65525 

380 PRINT"HALT ADDRESS REACHED’" GOTO70 
390 

400 GET HEX ADDRESS 
410 PROMT*-"START" 

420 SRCH*="" PPINTPROMPT*• INPUT" ADDRESS <HEX> = ",SRCH* 

430 IFLEN< SRCH* )O4THEN420 

440 GOSUB870 CONVERT TO BINARY 

450 I FLEN <. SRCH* > O2THEN420 

460 X=256*ASC<SRCH*>+ASC<MID*-!SRCH*, 2>> 

470 RETURN 
480 

490 CHECK HALT ADDRESS 

500 IF MEM-iAND HLTADR/65526• THEN HLTADR=65526’ 

510 IF MEM-2 AND HLTADR>512 THEN HLTADR-512 
520 IF MEM-2 AND HLTADR>22552 THEN HLTADR-22552 
530 RETURN 
540 

550 FETCH THE NEXT BYTE 

560 IFMEM-1THENX-PEEK v PC .* ELSEG0SUB690 

570 RETURN 

580 

590 PRINT X AS A 2-DIGIT HEX NUMBER 
600 PRINT RIGHT*'"00"+HE/» 2>; RETURN 

610 PRINT X AS A 4-DIGIT HEX NUMBER 
620 PRINTRIGHT*<"0000"+HEX*<X>, 4>> RETURN 

620 ' 

640 PRINT HEX, DECIMAL, & ASCII STRINGS 

650 PRINTTAB* 10 > GOSUB590 PRINT" " ; RI GHT * < " 0O0 "♦•MI D* ■' STP* < X >, 2 >, 3>> " 

660 IFX>32ANDXC91THENPRINTCHR*<X>; 

670 RETURN 
680 

690 FETCH BYTE FROM DISK BUFFER 

700 IFMEM-2THEN XPC-PCELSE XPC-PC+512 BOOTSTRAP S ON 1ST 4 SECTORS 
71G ADR-4+ <XPCAND127> TK*INT<XPC/4096> SC=2*< <XPC/128>AND31> IFSO30THEN 
SC-SC-31 


720 

730 GET TRACI IF NECESSARY 
740 IFTRK: -0THEN770 
750 TRK-0 SEC .*.'= 1 

760 IF'INP<8>AND64> :: 0THENWAIT8, 2, 2 0UT9-2 GOTO760 GET TRACK #0 
770 IFTRK-TKTHEN810 

780 WAITS, 2, 2 IFTRK: TKTHEN0UT9, 2 TRK-TRK 1ELSE0UT9,1 TR1=TRK+1 MOVE H 

EAD TOWARDS DESIRED TRACK 

790 SECZ—1 GOT0770 

800 GET SECTOR IF NECESSARY 

810 IFSECX-SCTHEN840ELSESEC ;.-SC ECNT-ld 

820 SEC'*-DSK I * • SECX ' TST*=DSK I » • SEC*; • READ SECTOR 

820 IFTST* :>SEC*THENECNT-ECNT 1 IFECNT: OTHENSSO ELSE G0SUB65525 PRINT"DI 

SK RE AC- ERROR" STOP 

840 X-ASC■MID*<SEC *.ADR > ; 

850 RETURN 
860 

870 CONVERT HEX STRING TO BINARY STRING 
880 J—1 S*-"" L-LEN<SRCH*> 

890 FORI-ITOL 

900 C*=MID*-SRCH*,I,1> IFC*«" "THEN950 
910 IFC*>-"0"ANDC*<*“9"THEND-ASC<C*>-ASC<"0" .• G0T0940 
920 IFC*>="A"ANDC*<="F"THEND—10+ASC<C* ASC - "A"> GOTO940 
920 S*="" 1=1. GOTO950 

94O J-CJ+1TAND1 IFJ=0THENT=DELSET-D+16*T S*=S*+CHR*-T> 

950 NEXT 

960 SRCH*—S* RETl IRN 

970 • 

988 PATCH ROUTINES 

990 GOSUB400 PC-X GET ADDRESS 

1000 PRINT PRINT"': OR X - ASCII XX = HE::. XXX = DECIMAL. RETURN = NO 
CHANGE" PRINT 

J010 IFMEM=2ANDPC>511 -OR - MEM-3ANDP023551 -THEN 380 

1020 CHNG-0 ADR-0 G0SUB560 SX-X ' FETCH BYTE 

1030 :=PC GOSUB610 PRINT" ", PRINT AC-DRESS 

1040 X—SX G0SUB650 PRINT TAB925 ' PRINT OLC- VALUE 

105O SRCH*-"" INPUTSRCH* L-LEN<SRCHi> PRINT NEW VALUE 

1060 IFL-0THEN 1140 JUMP IF NO CHANGE 

1O70 IFL-3ANDASC- SRCH*>=39THENSRCH*=MID*<SRCH*, 2, 1.- STRIP OFF QUOTES 
108O IFL-3THENIFSRC H*>="000"ANDSRCH*<="255"THENSRCH*=CHR*(VAL<SRCH* > ■ 
CONVERT DECIMAL 

109O IFL-2THENGOSUB870 CONVERT HEX 

11O0 I FLEN-. SRCH* ^ OITHENFR1 NT CHR*-7-"l BYTE AT A TIME" GOTO1O30 
1110 ' 

1120 MAKE PATCH 

1130 SX=ASCvSRCH*> IFMEM-1THENPOKEPC. SXELSEMID*<SEC*, ADR, l.'=SPCH* CHNG-1 
1140 FA=1 INPUT"PATCH 1> NEXT 2> THIS PREVIOUS BYTE 4> EXIT";FA 

IFFA :iORFA>4THEN1140 
1158 IFFA—2THEN1030 
1160 IFFA-4THENGOSUB1220:GOTO70 

1170 IFFA-1THENPC-PC+1.ADR-ADR+1ELSEPC-PC-1 ADR=ADR-1 
1180 IFMEM=1THEN1010 

1190 IFADR>—4ANDADR<—121THENGOSLIB840 SX=X GOTO103O 
1200 GOSUB1220 GOT01010 
1210 

1220 OUTPUT SECTOR IF CHANGES MADE 
1220 IFMEM-1ORCHNG-0THENRETURN 

1240 CS=0 FORADR-4T0131 CS=<CS+ASC:<MID*<SEC*, ADR> > >AND255 NEXT 
1250 MID*<SEC*, 133, 1>-CHR*'.'CS> UPDATE CHECKSUM 
1260 ECNT-10 

1270 DSKO* SEC*, SEC/i TST*=DSH*(SECX) WRITE SECTOR 

1280 IFTST*<>SEC*THEf4ECNT=ECNT-l:IFECNT>0THEN1270 ELSE G0SUB6552S PRINT- 
DISK WRITE ERROR" STOP 
1290 RETURN 

65509 

65510 SUBSTITUTE CENTRONIC PRINTER'S PORT * FOR CRT'S 

65520 IFTRMX-OANDINP< 33>-0THENTRMX-PEEK <4561> 0UT32,0.0UT34, 0 0UT33, 0 OU 
T35,255 OUT32.44 OUTS4,44 P0KE4561, 32:P0KE4562, 246 P0KE4563,0 P0KE4564 1 
94 P0KE4569, 35 

65521 RETURN 

65522 

65523 RESTORE THE CRT AS OUTPUT PORT 

65525 IFTRMX>0THENPOKE4561. TRMM P0KE4562, 230 P0KE4563, 2 P0KF4S64, 2©2 POK 
E4569, TRMX+1 OUTTRMX.3 OUTTRMX,17:OUTTRMX, 1 

65526 TRMX-0 RETURN 
OK 


Page 8 Dr. Dobb’s Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 Number 22 

64 


FEBRUARY SHOW IN PHILLY 


News Release Received:77 Dec 28 

1978 Business and Personal Computer Sale & Exposition 
Location: City Line Holiday Inn, Philadelphia, Pa. 

Date: February 27th to March 1st, 1978 

Hours: 10:00 A.M. to 8:00 P.M. 

For further information contact: Produx 2000, Roosevelt 
Blvd and Mascher St, Philadelphia, PA 19120 (215) 722-4837 


GERMAN COMPUTER CLUB HOPES 

Received: 77 Oct 10 

“Call for interested individuals in (northern) Germany to 
form a Hobbyist Computer Club. Please contact Ilja Burkoff, 
Parkallee 105, D-28 Bremen. Tel: (0421) 34 71 79.” 


I 


V 




PAD HEP 

•hTCHES ANY BYTE IN MEMORY HR ON THE OISL COPIES OF HITS' 4 O BASIC AND 
BAS l f BOOTSTRAP. ’LOADEF 

AL 1 EARCHES THROUGH ANV OF THE ABOVE TO t.OCATE A GIVEN ASCII OR BINARY 
STRING 

1> SEARCH 2 • PATCH? 1 

l; MEMORY • BOOTSTRAP 3> BASIC? 1 

DO YOU WANT HARD COPY? N 

START ADDRESS (HEX') * ° 0000 
END Ml 'DRESS (HEX) = ? 5C00 

L fHARAC TER- 2> HEX-STRING SEARCH 3) EXIT? 2 
SEARCH STRING = DBAS 

SEARCH STRING = HEX DB0S 

ADDRESS 

2E86 

2E96 

2EFD 

2F08 

3030 

305? 

3652 

IB69 

3B8F 

"BC? 

HALT ADDRESS REACHED' 

I- SEARCH 2■ PATCH? 1 

1 ■ MEMORY 2^ BOOTSTRAP 3 ■ BASIC? 3 

DO YOU WANT HARD COPY' 1 N 

START ADDRESS (HEX- = n OOOO 
END ADDRESS (HEX> = ° 1O0O 

1 • CHARACTER- 2) HEX-STRING SEARCH 3> EXIT? 1 
SEARCH STRING = RANDOM 

SEARCH STRING = RANDOM' 

ADDRESS 

069D 

HALT ADDRESS REACHED' 

If SEARCH 2> PATCH? 2 

1) MEMORY 2> BOOTSTRAP 3) BASIC? 1 
START ADDRESS (HEX) = ? 069D 

X OR 'X' = ASCII, XX = HEX, XXX = DECIMAL, RETURN = NO CHANGE 


069 D 


52 

082 

R 

? 





PATCH 

1> 

NEXT 

2> 

THIS 

3) 

PREVIOUS 

BYTE 

4) 

EXIT 0 

069E 


41 

©65 

A 

? 





PATCH 

1 • 

NEXT 

2) 

THIS 

3) 

PREVIOUS 

BYTE 

4) 

EXIT? 

*J69F 


4E 

078 

N 

? 





PATCH 

1) 

NEXT 

2) 

THIS 

3> 

PREVIOUS 

BYTE 

4) 

EXIT? 

O6A0 


44 

068 

D 

? C 





PATCH 

1> 

NEXT 

2) 

THIS 

3) 

PREVIOUS 

BYTE 

4) 

EXIT? 

06A1 


4F 

079 

O 

? I 





PATCH 

1) 

NEXT 

2> 

THIS 

3) 

PREVIOUS 

BYTE 

4) 

EXIT? 

06A2 


4D 

077 

M 

? D 





PATCH 

1> 

NEXT 

2> 

THIS 

3) 

PREVIOUS 

BYTE 

4> 

EXIT? 

1> SEARCH 2) 

PATCH 0 2 






1) MEMORY 2) 

BOOTSTRAP 

3) 

BASIC? 1 




START 

ADDRESS 

(HEX > 

■ ? 

2E86 





X OR 

X' 

= ASCII, 

XX = 

HEX. 

XXX = DECIMAL- 

RETURN = N 

2E86 


DB 

219 


? D3 




PATCH 

1> 

NEXT 

2) 

THIS 

3) 

PREVIOUS 

BYTE 

4> 

EXIT? 

2ES7 


08 

008 


? 09 




PATCH 

1) 

NEXT 

2) 

THIS 

3) 

PREVIOUS 

BYTE 

4) 

EXIT? 




Number 22 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 9 




65 

















A Simple Technique for Static Relocation of 
Absolute Machine Code 


BY GARY AKILDALL 

Digital Research 
Pacific Grove, CA 93950 

One principal difficulty with newly evolving computer 
technology is that software generation tools generally lag 
corresponding hardware facilities, thus forcing the software 
engineer to resort to outmoded techniques to produce soft¬ 
ware systems. 

The purpose here is to present one area of difficulty—that 
of a static program relocation—and to offer a simple solution 
which can be applied to nearly any microcomputer software 
environment where relocation is not supported by the manu¬ 
facturer. 

The need for static relocation arises most often in a situa¬ 
tion where the software systems must be reconfigured in the 
field. For example, data entry equipment manufacturers often 
provide a range of optional peripherals which can be attached 
to user’s equipment as processing requirements change. Each 
peripheral usually requires a software “driver” which is device¬ 
specific, and interfaces the device to the operation environ¬ 
ment. 

A common approach to software reconfiguration is to 
arrange the individual translated peripheral drivers into distinct 
machine code modules which can be selectively brought 
together to form an integral system at the customer site. 
In order to perform the field reconfiguration, each module is 
translated so that it originates at location 0 in memory and, 
when it is brought together with other modules, it is placed 
at the next available memory location as the system is being 
constructed. All machine code elements which are location 
dependent must, of course, be altered to reflect the actual 
locations that the driver occupies. Generally, the elements 
which are affected are the addresses of branch destinations 
and data addresses. If the locations of the affected addresses 
in each module are known ahead of the system reconfigura¬ 
tion, the module can be placed anywhere in the final memory 
image. 

Simple Static Relocation 

The process of constructing an executable memory image 
from a set of relocatable modules, as described above, is 
called static relocation. Unfortunately, very few microcom¬ 
puter manufacturers produce the address information with 
their translator output which is required for the relocation 
process. The method described below, however, can be applied 
to the output of most manufacturers’ absolute translators to 
derive the necessary relocation information. In order to be 
specific, the Intel 8080 microcomputer is used in the 
discussion with the understanding that the concepts can be 
easily extended to differing architectures. 

The Intel 8080 microcomputer has a 64K (65536 bytes) 
memory space which can be thought of as 256 “pages” of 256 

Page 10 

66 


bytes per page. Data and instructions are intermixed in this 
memory space, and are addressed with a 16-bit address 
operand which can be divided into an 8-bit (high-order) page 
address (0-255), and an 8-bit (low-order) address within a 
page. Typical 8080 instructions which can use these address 
operands are shown in Figure 1, where PA denotes the page 
address, and AWP denotes the address within a page. In 
general, a machine code memory image consists of instruc¬ 
tions, instruction addresses, and data items. The instructions 
and data items are independent of the actual location at 
which the module finally resides. Further, only a subset of the 
instruction addresses are dependent upon the module location. 
That is, a load instruction may reference a buffer address 
which is fixed outside the relocatable module, in which case it 
does not change when the module is moved into position. If 
the address references a branch location or data item within 
the module, then the value of PA, AWP, or both, must be 
biased by fixed values, dependent upon the final position of 
the module in the resulting configuration. 


MVI A, 

PA 

Move immediate to A 

MVI C, 

AWP 

Move immediate to C 

LXI D, 

AWP 

PA 

Load DE with address 
Jump to address 

JMP 

AWP 

PA 


Figure 1. Typical 8080 Instructions 

A simpler form of relocation, called “page boundary 
relocation,” is usually sufficient for field reconfiguration. 
In this case, the module is relocated to a page boundary 
so that only the page address (PA) need be changed to perform 
the relocation, since the address within a page (AWP) remains 
constant. 

Page Boundary Relocation 

In its simplest form, page boundary relocation can be 
accomplished by constructing two parallel memory images 
for each module. The first, called the “relative-0” image is 
created by translating the module for execution at location 0. 
The second, called the “relative-1” image is produced by 
translating the module for execution at page 1 (address 256). 
The relative-0 and relative-1 memory images can then be 
compared to determine the high-order address elements which 
must change when the module is moved to its final page 
boundary location. Figures 2a and 2b show a simple program 
segment assembled as relative-0 and relative-1 images. The 
differences in the machine code images are circled, and are 
thus the high-order addresses which must be biased when the 
module is moved. Figure 2c shows the same program segment 
assembled at page 5. Note that if the circled address fields in 
the ralative-0 image are biased by an amount 5 (corresponding 
to page boundary 5), they result in the proper values for the 
relocated program. 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 22 


0000 


org 

OOOh 

.'relative 0 assembly; 

| jnn|aaaa 

|tt|dld2. . .dn|cc | 

OOOO 

3E00 

start : mvi 

a,d1 

shr8 page address to a 



0002 

OEOA 

mvi 

c.dl and Offh .address in page 

nn 

— record length 01 - FF 

0004 

110A00 

lx i 

d,d1 

;full address to d, e 

aaaa 

load address 0000-FFFF 

0007 

C30000 

jmp 

start 


tt 

— record type = 00 



; data area 



dl 

— data byte 1 

000A 


dl: ds 

2 

;two unfilled 

d2 

— data byte 2 

OOOC 

00 

db 

0 

;one filled element 



000D 


end 



dn 

— data byte nn 



Relative-0 



cc 

— checksum byte 



Hex 

File: 



JOA|OO0qoq3EOOOEOAllOAOOC3OOO0tC2 


Figure 3. Hex File Format 


dOlJOOOQ 


PQOOF3 


odooododoo 

Figure 2a. Relative-0 Assembly 


0100 



org 

100h 

.•relative 1 assembly 

0100 

3E01 

start: 

mvi 

a,d1 shr 8 page address to a 

0102 

OEOA 


mvi 

c,d1 and Offh;address in page 

0104 

110A01 


ixi 

d,d1 

;full address to d,e 

0107 

C30001 


jmp 

start 





data area 



01OA 


dl: 

ds 

2 

;two unfilled 

01OC 

00 


db 

0 

;one filled element 

010D 



end 





Relative-1 

Hex 

File: 


0A1010O00I3E010E0A110A01C30001JBE 


ON 


oiod 


00I00F2 


odooododoo 

Figure 2b. Relative-1 Assembly 


0500 



org 

500h 

;assembly at page 5 

0500 

3E05 

start: 

mvi 

a,d1 shr 8 page address t 

0502 

OEOA 


mvi 

c,d1 and Offh;address in p; 

0504 

110A05 


Ixi 

d.dl 

;full address to d,e 

0507 

C30005 


jmp 

start 




’ 

data area 





dl: 

ds 

2 

;two unfilled 

050C 

00 


db 

0 

;one filled element 

050D 



end 




An absolute loader reads each record of the hex file, and 
loads the byte values at the load address specified by LA for 
the next RL bytes, as shown in the algorithm of Figure 4. The 
notation used in this algorithm is that of Knuth [Kn.], where 
each step is labeled with a step name (Al. . . A16), followed 
by a comment describing the action of the step. The action 
itself is a series of assignments of expressions to variables, and 
conditional control transfers. The algorithm begins at step Al, 
and scans for the beginning colon for each record. When 
found, the algorithm reads the record length and, if zero, 
terminates the load operation. If the recrod length is not zero, 
the load address is read followed by the record type (which 
should be zero). The algorithm then loops between steps A6 
and A12, reading successive bytes to memory while computing 
the checksum. When the entire record has been loaded, the 
final checksum byte is added, which should result in a zero 
value. Upon completion of the algorithm of Figure 4, the 
entire hex file has been read and loaded to an absolute loca¬ 
tion in memory. 

The algorithm of Figure 5 is a simple extension of the pre¬ 
vious absolute loader, which reads two successive hex files. 
The first hex file is the relative-0 machine code, produced by 
translating the module for execution at location 0. The second 
hex file is the relative-1 machine code, resulting from the 
module translation when originated at location 256 (100 in 
hexadecimal). The first part of the algorithm, given by steps 
Al through A16 is similar to that of Figure 4, except that the 
data is loaded to address LA+PG*256 which effectively 
moves the module to the page boundary given by PG rather 
than absolute address LA. 


0A)0500)00I3E050E0A110A05C30005|AE 

OTO5OCO0OOEE 

dooloooobaoo 

Figure 2c. Assembly at Page 5 


The program which actually performs the relocation 
process is a simple modification of an absolute loader. The 
translator output for an 8080 microcomputer is a “hex 
format” file, containing a sequence of absolute records which 
give a load address and byte values to be stored starting at 
the load address. The exact format of each record, shown in 
Figure 3, begins with a colon (:) followed immediately by 
a two digit record length (RL) and 4-digit load address (LA). 
The 2-digit record type (RT) is always zero for absolute 
records, and is followed by RL pairs of hexadecimal digits to 
be placed at LA through LA+RL—1 in memory. The record 
terminates with a pair of checksum digits: if the byte values 
(hexadecimal digit pairs) are summed, starting immediately 
after the colon, and, continuing through the end of the record, 
including the checksum byte, then the sum should be zero 
when computed with an 8-bit counter. The checksum byte 
is included as an error detection mechanism. The last record 
of a hex file is denoted by a record length of 00. 


Note: nextchar reads the next ASCII character 
nextbyte reads the next pair of digits 
nextaddr reads the next pair of bytes 
CS is the checksum accumulator (8-bits) 
R L is the record length (8-bits) 

LA is the load address (16-bits) 

M[x] is memory location x (8-bits) 


Al 

[scan for :] 

if nextchar 4 go to Al 

A2 

[set checksum] 

CS : = 0 

A3 

[get length] 

R L : = nextbyte 

A4 

[last record?] 

if RL = 0 go to A16 

A5 

[set address] 

LA : = nextaddr 

A6 

[set type] 

RT : = nextbyte 

A7 

[load bytes] 

if RL = 0 go to Al3 

A8 

[get byte] 

b : = nextbyte 

A9 

[store byte] 

M [LA] : = b 

Al 0 

[checksum] 

CS : = CS + b 

All 

[next addr] 

LA : = LA + 1 

Al 2 [count length] 

RL : = RL - 1,go to A7 

A13 [checksum] 

CS : = CS + nextbyte 

A14 [total ok? ] 

if CS = 0 go to Al 

A15 [check error] 

halt, "checksum error" 

A16 [normal end] 

halt, "tape read ok" 


Figure 4. Absolute Loader Algorithm 


Number 22 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 11 

67 






Upon reaching step A16, the module has been loaded into 
memory at page PG but is translated for execution at loca¬ 
tion 0 and thus would (most likely) execute improperly, since 
the high order branch and data addresses must be biased by an 
amount PG. Thus, steps R1 through R19 read the relative-1 
hex file to determine the addresses which must change. These 
steps are similar to A1 through A16, except the input data is 
compared with memory for differences, rather than actually 
placed in memory. In step R5, the load address is read as 
before but, since the relative -1 machine code is biased by one 
page, the effective address must be reduced by 256 bytes. 
Step R9 compared the data loaded in the first phase with the 
data read in the second phase: if the data is the same, then the 
element is invariant in the relocation process. If the data dif¬ 
fers, then it must have been due to the difference in the 
relative-0 and the relative-1 memory images. Further, this 
difference must be exactly 1 since differences occur only in 
the high-order address fields; otherwise an error occurs, and 
the module cannot be relocated. When a relocatable element 
is found, the original value loaded and relocated in phase 1 
must be biased by an amount PG in step R11. Upon comple¬ 
tion of the second phase, the algorithm halts at step R19 with 
the high order addresses altered by the proper amount in the 
relocated module. Note that the algorithm given in Figure 5, 
when applied to the relative-0 file of Figure 2a, followed by 
the relative-1 file of Figure 2b, produces the relocated 
machine code of Figure 2c, when page boundaiy PG=5 is 
used. 


Note: nextchar, nextbyte, nextaddr, 

CS, RL, LA, and M are identical to 
Figure 4. PG is the page number 
where the relocated module will reside. 

A1 [scan for:] if nextchar+ go to A1 


A2 [set checksum] 

CS 

- 0 

A3 [get length] 

RL 

= nextbyte 

A4 [last record?] 

if RL 

= 0 go to A16 

A5 [set address] 

LA 

= nextaddr 

A6 [set type] 

RT 

= nextbyte 

A7 [load bytes] 

if RL 

= 0 go to A13 

A8 [get byte] 

b 

= nextbyte 

A9 [store byte] 

M [LA + PG * 256] :=b 

A10 [checksum] 

CS 

= CS + b 

All [nextaddr] 

LA 

= LA + 1 

A12 [count length] 

RL 

= R L — 1, go to A7 

A13 [checksum] 

CS 

= CS + nextbyte 

A14 [total ok? ] 

if CS 

= 0 go to A1 

A15 [check error] 

halt, 

'checksum error" 

A16 [end rel -0] 

go to Rl 

Rl [scan for :] 

if nextchar + ":" go to R1 

R2 [set checksum] 

CS 

= 0 

R3 [get length] 

RL 

= nextbyte 

R4 [last record?] 

if RL 

= 0 go to R19 

R5 [set address] 

LA 

= nextaddr + 256 x (PG 

R6 [set type] 

RT 

= nextbyte 

R7 [record done?] 

if RL 

= 0 go to R15 

R8 [compare data] 

b 

= nextbyte 

R9 [data same?] 

if b = 

M [LA] goto R12 

RIO [page diff 1?] 

if b + M [LA] + 1 go to R18 

R11 [relocate] 

M [LA] : = M [LA] + PG 

R12 [checksum] 

CS 

= CS + b 

R13 [next address] 

LA 

= LA + 1 

R14 [count length] 

RL 

= RL — 1, go to R7 

R15 [checksum] 

CS 

= CS + nextbyte 

R16 [total ok?] 

if CS 

= 0 go to Rl 

R17 [check error] 

halt, 

'checksum error" 

R18 [reloc error] 

halt. 

'relocation error" 

R19 [end rel -1 ] 

halt. 

'relocation done" 


Figure 5. Relocating Loader Algorithm 


The algorithm of Figure 5 can be easily translated to an 
appropriate assembly or high-level language program to 
perform this relocation process. 

The processing of Figure 5 can be used to produce a more 
compact form of the relocatable module by building a “bit 
vector” which tabulates the addresses which require relocation, 
rather than actually performing the relocation process. That is, 
in step R11 the address LA must be biased by an amount PG 
for proper execution when the module originates at address 
PG*256. Thus, on the first pass, the data can be read to 
memory and, upon completion of the pass, a bit vector is 
constructed which has one bit position for each address within 
the module. Before starting step Rl, the entire bit vector is 
zeroed to indicate that no addresses require relocation. As the 
second phase processing proceeds, each relocation address 
determined in step Rl 1 can be “marked” by setting the cor¬ 
responding position of the bit vector. Upon completion of the 
algorithm, the bit vector contains zeroes in the positions cor¬ 
responding to addresses which are invariant over the relocation, 
and ones in the positions which require biasing by an amount 
PG. The entire relocatable module can then be saved for later 
static relocation. 

Given that the relative-0 memory image has been saved 
along with the relocation bit vector, the page boundary 
relocation can be simply accomplished by reading the memory 
image to its relocated page address PG. The bit vector is then 
read and processed: for each bit position which is set, the 
value PG must be added to the corresponding element which 
was previously loaded. Note that this extension to the basic 
algorithm of Figure 5 is included only for compact represen¬ 
tation, and produces exactly the same memory image as the 
original algorithm. 

A Case In Point 

The following situation shows a case where page boundary 
relocation is useful. The CP/M operating system [Ki] is a 
simple small computer diskette based software system, which 
implements a file management and program loading facility for 
microcomputer development. The operating system is arranged 
as a set of modules which are loaded into memory when the 
computer system is started. User programs are then loaded 
into memory from the diskette and, because of memory con¬ 
straints, must overlay non-essential portions of the CP/M sys¬ 
tem to reclaim storage for program and data areas. In order to 
allow these areas of memory to be reclaimed, the CP/M system 
is loaded into the high addresses of the memory space, and the 
user programs are loaded into the low addresses. Thus, the user 
programs can overlay the high addresses of memory when 
necessary and, upon completion, cause the CP/M system to 
be brought back from the diskette for the next operation. 

Given that relocation is not supported by the manufacturer, 
this memory organization presents a fundamental difficulty: 
each CP/M operating system must be tied directly to the 
memory size. If the user of CP/M owns a computer system 
with 16K bytes of memory then a 16K version of CP/M must 
be supplied. If the user adds memory to enhance system 
capabilities, a different version of CP/M must be supplied to 
support the larger memory space. 

In order to overcome this difficulty, the CP/M system can 
be reconfigured in the field to accomodate the increased mem¬ 
ory using the page boundary relocation technique described 
above. In particular, each user receives a 16K version of CP/M 
(the smallest amount of memory which is useful for CP/M 
operation), along with a program which implements the recon¬ 
figuration. The user may optionally execute the program 
which rebuilds the CP/M system, according to the existing 
memory size, and places the relocated memory image back on 
the diskette, ready for subsequent loading. 


Page 12 

68 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 22 




FASTER DATA ENTRY FOR SC/MP 



The CP/M debugger program, called the Dynamic 
Debugging Tool (DDT), also resides in the upper portions of 
memory so that it can co-exist with the programs under test. 
Again, the area in which DDT is loaded depends upon the 
current memory configuration, and thus page boundary 
relocation is performed each time the DDT program is brought 
into memory. The increased elapsed time for relocation of 
DDT is negligible when compared to an absolute load, as long 
as the bit vector technique of the previous section is used. 

Restrictions 

It should be noted that the technique described here is 
by no means a complete linking loader: no address resolution 
is provided between modules, and no load-time address 
arithmetic is allowed. Sets of modules which co-exist in 
an integral system must communicate through instruction 
and data addresses. Using the technique presented here, the 
communication must be performed through dedicated 
absolute addresses for data items. Further, instruction addresses 
must be established through a “root module” which contains 
a jump vector with vector elements for each possible module 
which could be configured in a final system. 

Address arithmetic is often useful when combining modules. 
In the simple page boundary relocation described above, 
all address arithmetic must be performed at assembly or 
compile time, and must consist only of simple operations 
which involve a fixed positive or negative offset from a base 
address, or a shift or logical and operation which extracts the 
8-bit page address of a full 16-bit address. A relocation 
error will occur, for example, if an 8-bit immediate operand 
instruction is obtained from a 7-bit right shift rather than an 
8-bit right shift of an address quantity. 

In spite of these shortcomings, the technique has particular 
advantages in being independent of a manufacturer’s capa¬ 
bilities, whims, and fancies. All language processors must 
eventually produce an absolute memory image for execution 
on the target machine, and thus the relocation process 
presented here will continue to operate when new software 
tools are introduced. 

Acknowledgements 

The author would like to point out that the techniques 
presented here, although useful, are most likely not original 
or particularly inventive. In fact, at least one individual, 
Bruce VanNatta of IMS Associates, San Leandro, California, 
has independently applied the methods to produce relocatable 
PL/M programs. There are most certainly many other software 
designers who have approached the relocation problem in a 
similar fashion. 

References 

Kildall, G., Microcomputer Software Design: A Checkpoint. 
Proceedings of the Fall Joint Computer Conference, 1975. 

Knuth, D., The Art of Computer Programming. Volume I: Funda¬ 
mental Algorithms. Addison-Wesley, Reading, MA, 1975. 


Dear Dr. Dobbs, Received: 78 Jan IB 

Using the SC/MP kit (actually it is called Introkit this side 
of the Big Lake) with the keyboard addition I often cursed the 
program entry method as being somewhat slow. You have to 
press MEM, TERM, then enter your data, and finally press 
TERM again. That makes 5 keystrokes per byte where most 
systems only use 3, i.e. two for the hex digits and one carriage 
return. The enclosed program should solve this problem. All 
should be self-explanatory except for a few details: 

1. The initial data display is always 00, the following (after 
first TERM) shows true data read from memory. 

2. Assembler syntax is not standard but from a home¬ 
brewed ‘cross’ on an HP 9825A. The main difference is in 
hex notation — I use xxH where National uses X’ or leading 
zero. 

3. The program is relocatable as only PC-relative jumps are 
used (besides using SCMPKB which is assumed to start in 
0000 ). 

Best of all, 

Erik Skovgaard 
Nordlundsvej 10 
DK-2650 Hvidovre 
DENMARK 

***** FSTKEY SCMPKB FAST DATA ENTRY ROUTINE ***** 


$$$$ Track 1 File # 6 


1 

2 

3 

4 

5 

e 

7 

8 


ROUTINE FOP FAST ENTRY OF 
PROGRAMS USING SCMPKB SYSTEM 
JUST KEY IN BYTE AND PRESS TERM 
ADDRESS IS THEN AUTO INCREMENTED 
AFTER STOPINC THE BYTE. 

ABOFT KEY RETURNS CONTROL TO SCMPKB 
PROCRAM ENTRY ADDR IS CIVEN IN LOC 
CF15 (UPPER) AND 0F16 (LOWER) 


9 


10 

0F30 

C4 OF 


LDI 0FH 

;P2=0F00 

11 

OF 32 

36 


XPAH P2 


12 

OF 33 

C400 


LDI 0 


13 

OF 35 

32 


XPAL P2 


14 

OF 36 

C21 5 


LD 15H (2) 

;GET ADDRESS 

15 

OF 38 

CA0E 


ST 0EH (2) 


16 

OF 3A 

C216 


LD 16H(2) 


17 

0F3C 

CA0C 


ST 0CH(2) 


IP 

OF 3E 

C400 


LDI 0 

;CLEAR DATA 

19 

0F4 0 

CA0D 


SI CDH(2) 


20 

0F42 

900B 


JMP "GODIS" 


21 

OF 44 

C20D 

NUM: 

LD 0DH(2) 


22 

0F4 6 

IE 


RR 

;SHIFT DIGIT 

23 

0F47 

IE 


RR 


24 

OF 48 

IE 


RR 


25 

0F4 9 

IE 


RR 


26 

0F4A 

D4F0 


AN I F OH 

;AND APPEND 

27 

OF 4C 

58 


ORE 

;NEW DIGIT 

28 

0F4D 

CA0D 


ST 0DH (2) 

;SAVE RESULT 

29 

0F4F 

C401 

GODIS: 

LDI 1 


30 

OF 51 

37 


XPAH P3 

;P3*D1SP ROUTINE 

31 

OF 52 

C43F 


LDI 3FH 


32 

0F54 

33 


XPAL P3 


33 

0F55 

3F 


XPPC P 3 

;DISPLAY 

34 

0F56 

9 00 2 


JMP "CMD" 

;COMMAND RETURN 

35 

0F58 

9 0EA 


JMP "NUM" 

; NUMBER RETURN 

36 






37 




;COMMAND 

PROCESSING 

38 




;ANY CMD 

EXCEPT ABT IS OK. 

39 






40 

OF 5A 

C20E 

CMD: 

LD 0EH(2) 

;P3«NEW ADDR 

41 

0F5C 

37 


XPAH P3 


42 

OF 5D 

C20C 


LD 0CH(2) 


43 

0F5F 

33 


XPAL P3 


44 

0F60 

C2CD 


LD 0DH(2) 


45 

0F62 

CF01 


ST @1(3) 

;STORE BYTE, INCR 

46 

0F6 4 

C30 0 


LD 0(3) 

;READ NEXT BYTE 

47 

0F66 

CA0D 


ST 0DH (2) 


48 

0F68 

37 


XPAH P 3 

;STORE NEW ADDR 

49 

0F69 

CA0E 


ST 0EH(2) 


50 

0 F6B 

33 


XPAL P3 


51 

0F6C 

CA0C 


ST 0CH(2) 


52 

0F6E 

90DF 


JMP "GODIS" 

;DISP NEW VALUES 


NUM - 0F44 
GODIS = 0F4F 
CMD = 0F5A 


Number 22 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 13 


69 






Relocation Is Not Just Moving Programs 


BY RICHARD L. ROTH 

5 North Salem Rd. 

Ridgefield, CA 06877 
(203)438-3954 
© RLR 1977 

Once you start writing assembly language programs you will 
find every program requires certain functions. Some functions 
are so common, such as getting a character from the console 
terminal, that you can build them into a system monitor. This 
monitor can be put in PROM or loaded when you turn your 
machine on. But the large majority of common functions are 
only used for a class of programs. It’s wasteful to always have 
them around so you only have them in memory when you 
need them. During the stage of small programs and hand 
assembling, each time you want any of the common functions 
you must move it to the appropriate place and you must 
‘relocate’ all absolute addresses, usually jumps and data. But 
as programs get bigger and as the number and kind of common 
modules grow, it behooves one to let the'computer do the busy 
work of moving those modules. At the low level, if you separ¬ 
ate your code from data, you might find a relocator that can 
move absolute code-fine for a 10 or 256 byte program. Not 
so fine for 4000 bytes, esp., since you must watch carefully to 
see if all the constants that look like addresses are not 
changed. The next step up is to have an assembler do the dirty 
work and start each program with a common set of routines, 
in source. At around 6-8K of program code, even this becomes 
unmanageable since just handling a source file that is 60K or 
1000K can take 15 minutes just to read it off a floppy disk. 
Keeping track of a program becomes harder and harder as it 
gets bigger, a 2K program can have a 30 page listing if it’s 
well commented. The final answer is to produce an intermed¬ 
iate phase where the computer has converted all the code to 
internal form, i.e., the machine instructions are directly in hex 
or octal, but is still keeping track of jumps and other location 
dependent information. 

Relocation Schemes 

There are two general categories of relocation information: 
dynamic and static. Dynamic relocation refers to information 
still present at run-time which allows code to be moved. The 
relative jump that the Z-80, 6800 and 6502, as well as most 
large computers have is a good example. It runs the same no 
matter where it is in memory. Minicomputers like the PDP-11 
and NOVA have enough relative-type instructions that proper¬ 
ly written code can almost be moved between instructions and 
still run properly. Large computers use a base register which 
points to the start of the program and do all addressing relative 
to that. Unfortunately, most micro’s either are not this flexible 
or require very careful, expensive coding to do so. 
to keep the relocation information around until all the 
modules can be put together to form a final program. But in 
forming the final program, all addresses are resolved into ab¬ 
solute addresses. 

A Little Linking With Your Loader? 

The two things an advanced assembler/linker scheme must 
do are: move the code to the proper memory position, (reloca¬ 
tion) and allow modules to call each other by name, (linking). 
A primitive form of linking is done in most large absolute 

Page 14 


programs by providing branch vectors. By previous agreement, 
a set of jumps are set-up directly after each other, each jump 
going to some internal module start. So if a program knows 
where the jump vector is, it can get to any specific routine. A 
full linking loader actually keeps the symbolic name assigned 
to the routine or data location, and matches it with the 
module that references the name as an externally defined 
symbol. Some machines (such as 6502 and 6800) have a 
special section of memory treated differently, called page 
zero or base page. A good linker should help the programmer 
manage page zero, as usually it’s limited to 256 bytes or so, 
but is very important. 

The Process 

The final process consists of two or three steps. Each 
module is assembled into a ‘relocatable object’ module. Then 
all the object modules are combined by the linker into a single 
object module, which is still relocatable. Finally the loader 
converts the relocatable module into an executable load 
module. Very often the process is simplified by combining the 
linking and loading, so one program takes all the separate relo¬ 
catable object modules and produces an executable load 
module. 

In addition to the general simplification in managing smal¬ 
ler modules and the ability to just keep object modules for 
common functions, a whole new capability enters the picture. 
Any program which generates a similar object module can be 
accepted by the linker/loader. This means FORTRAN, 
Assembler, even BASIC modules can be combined into one 
program, providing the object form is correct. (NOTE-most 
BASIC’s in use today do not fit this scheme because they do 
not actually generate machine code. But if the BASIC inter¬ 
preter has a simplified loader built-in, it can use those other 
modules.) 


With Reference to a Relocatable Object Format 

I have now reviewed a dozen or so relocatable formats, in 
addition to implementing my own for a number of machines. 
Of those specifically for microcomputers, there are two roads 
of thought: binary and ASCII. The binary direction tends to 
be one of storage optimization, to the extreme of a pure bit 
stream. The ASCII direction relates to interchangeability and 
manageability, as ASCII is generally easier to move and 
manage than binary. This is partially due to the human read¬ 
ability. For 8080/Z-80 processors, the INTEL absolute hex 
format is often the starting point for building a full format. 

When I started writing my relocatable, linking assembler 
in early 1977, I reviewed all the available formats and decided 
on the ASCII direction because of manageability. As 1 devel¬ 
oped the scheme, I kept building with a key goal being human 
interaction. My format can be directly read, once the basic 
rules are learned. 

My orientation is 8080 byte machines with disk level cap¬ 
ability. Common address is a 16-bit value. 8-bit values gener¬ 
ally occur as parameters that may be handled on the source 
level by ‘Including’ a parameter file at assembly time. Module 
linkage is handled by allowing externals between modules. 
Again, 16-bit values are sufficient. It is occasionally desirable 
to add or subtract an offset from an external or do arithmetic 
with externals. However, most often these practices lead to 


Dr. Dobb’s Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 22 


70 



bad programs so 1 decided not to allow other than simple 
references. 

As I developed my capabilities, simple relocation was not 
enough. I needed the capability to separate code and data 
into separate segments, to ease writing PROM-able software. 
Hence to the normal relocatable segment (ROG), I added a 
RAM segment. At the same time, I added further capability 
to handle FORTRAN-like common blocks. 

With the assembler and linker as usable tools, I built up a 
library of often used functions. The most useful is a module 
that allows character I/O to be done with disk, console, print¬ 
er, reader, or punch. My selection of an ASCII format greatly 
simplified this library development. As to building a library, 
all that has to be done is to concatenate the appropriate 
individual modules into one file. 


RLR Relocatable Object Format Specification 
Rev 1.0 


Version 1.1 12/1/77 

This is the specification of a relocatable object format for 
micro-processors. It is copyright (RLR 1977), but released for 
general use providing that acknowledgement is made to the 
source and any modifications are specified and returned to the 
source for comment. 

RLR Standard Relocatable ASCII Format 

a) The ‘Assembler’ or ‘Compiler’ produces an ‘Object’ module 
of ASCII records. 

b) If the module contains relocating and/or linking informa¬ 
tion, it is a ‘Relocatable object’ module. 

c) The ‘Linking Loader’ produces an ASCII ‘Object’ module 
or a binary ‘Load’ module. 

d) An ‘Entry’ symbol is a symbol defined locally and known 
to other programs (alias public or internal symbol). 

e) An ‘External’ symbol is a symbol used locally, but defined 
in another program. 

0 A ‘Local’ symbol is only known within a program. 

g) An ‘Object’ module consists strictly of ASCII characters; 
parity may be supplied. Each record begins with a delimiter 
and ends with a return and line feed. The delimiter is 
*=’ (3DH), although data records of absolute data may 
begin with the Intel delimiter ‘: ’ (3AH). Numeric informa¬ 
tion is presented as hexidecimal ASCII with optional encod¬ 
ing. Once the encoding is removed, hex digits (0.. 9, A.. F) 
will remain. The encoding is used to specify relocatability 
or externality. 

h) A ‘Symbol’ is up to 6 printable characters, excluding ‘ * ’. 
Symbols with a length of less than 6 are right filled with 
‘ * ’. The system may recognize certain special symbols: 

‘STACK’ — top of program stack 

‘MEMORY’ — first location of free memory. 

‘ ? ’ — Blank common (for FORTRAN) 

i) All relocation is of 16-bit values, although optional formats 
provide use of high or low byte only. Relocation is handled 
by declaring program or data ‘Segments.’ A segment is an 
independently locatable section of data or code. Three 
standard segments are provided: ROG (for normal use or 
code), RAM (for data) or COM (for common data blocks, 
per FORTRAN). ROG and RAM segments are handled 
similarly as independent sections. COM is mapped so that 
all COM symbols in different modules refer to the same 
block of memory. Each segment allows for 64K addressabil¬ 
ity, unless an optional format is specified. 

j) ‘Mode encoded ASCII’ is used to indicate relocatability or 
externality of data. All encoded data are 16-bit values, 
most significant byte first. The first character is encoded 


based on the meaning of the data, the remaining 3 charac¬ 
ters are hex ASCII. All encoded data is converted into 
16-bit data by resolving the relocation or other meaning 
and then output as 2 absolute data bytes. If appropriate 
(i.e., 8080/Z-80 type processors) then data is output least 
significant byte first. If an optional format is specified, 
encoding may indicate only the high or low byte is to be 
output. Normally, a direct mapping may be made from 
2 bytes of input data, to 2 bytes of output data, 

k) An ‘Object file’ is a file consisting of one or more object 
modules. 


Record Formats 


character 


0 

1 . .2 
3. .6 
7. .8 
9.. N — 2 
N-1..N 

Record length: 

Normally contains number of data bytes in record. This 
implies length*2 characters of data. Symbols records specify 
length as number of symbols. Any record with length of zero 
is recognized as end of module record, regardless of record 
type. 

Record type: 

0 data record 

1 symbol record or end of file record 

2 name record 

3 library mark 

4 option record 

5 data count record 

6 fix-up record 
Checksum: 

The checksum is a total of all numeric data bytes in the 
record. Symbols are not added nor is the encoding informa¬ 
tion. The checksum number is the negative of the 8-bit total 
of all data bytes, discarding any carry. So that if all data 
including the checksum are added, the overall total should be 
zero. This is the standard Intel checksum. 


meaning 

record mark (‘: ’ or ‘ = ’) 

record length (0 if eof record) 

load address (may be mode encoded) 

record type 

data 

checksum 


Specific Record Types 

Data Record (type 0) 

0 ‘: * or ‘ = ’ 

1. . 2 record length (data bytes) if 0, eof record with 
load address meaning starting adr. 

3.. 6 load address, (MSBy first) can be mode encoded, 
relocatable 

7. . 8 ‘00’ (record type) 

9. . (8+len*2) data, can be mode encoded. Mode encoded 
data never folds over record boundary 
(9+2*len).. (10+2*len) checksum 

Symbol record (type 1) 

0 

1. . 2 number of symbols 

3. . 8 ‘000001’load adr & record type 

9. . (8+12*len) symbol entries (number specified) 

(9+12*len).. (10+12*len) checksum 

Each symbol entry is 12 characters: 

0. . 5 name (6 characters, right filled with ‘ * ’) 
6. . 9 value (LSBy first, absolute hex) 

10. . 11 type (absolute hex) 


Number 22 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 15 


71 



Symbol type bit assignment: 

(lsb) 

0 

mode (0-absolute, 1-relocatable) 

1 

defined (1—true) 

2. . 3 

scope (00B—local, IB—entry, 

10B—external, 1 IB—common) 

4 

equivalance (defined via EQU in asm 
program) 

5.. 6 

segment (00B—ROG, 0IB—COM, 

1 IB, system) 

7 

(msb) 

undefined 


Value’s meaning depends on symbol scope. If external, then 
the value is a serial number of the external. Serial numbers 
start at zero (0). This will be referenced when a data item is 
encloded as external. If common, then the value is the length 
of the common block which the symbol defines. Otherwise, 
local or entry, the value is the relative address of the symbol 
within the appropriate segment. 

Standard type bit settings: ([ ] indicates optional values) 
absolute symbol: [entry scope] + [equate] + [defined] 
relocatable symbol: [entry scope] + segment + relocatable 
+ [equate] +defined 
external symbol: external scope 
common symbol: common scope + defined 
Name Record (type 2) 

0. .2 ‘=04’ 

3. . 6 size of ROG segment (MSBy first, absolute hex) 

7.. 8 ‘02’ (record type) 

9. . 14 module name (right filled with ‘ * ’) 

15. .18 size of RAM segment 
19. .22 size of COM segment 
23. .24 checksum 

Module name is used for identification and selective load 
processing. If an unnamed module is selectively loaded or dup¬ 
licate names exist, the loader should indicate a state of 
confusion. 

Library Mark (type 3) 

0 . .2 ‘= 01 ’ 

3.. 6 function 

7.. 8 ‘03’ (record type) 

9. . 10 checksum 

The function indicates that all modules to follow in the 
current file are either to be forced loaded or selectively loaded. 
The loader starts loading a file in forced load mode. If 
switched to selective load mode, only modules that fill 
unresolved externals will be loaded. However, as the module 
name is used to catalog modules to be loaded, no duplicate 
module name must exist for any module that is considered 
for selective loading. The same file can switch between forced 
and selective load. 

Image Record Examples 

data: 

=NNAA AA00 < DD* > CK < CR/LF > 

N—number of data bytes 
A—load address 
D—data 
symbol: 

=NN000001 < SSSSSSWWTT*N > CK < CR/LF > 
N-number of symbols 
S-symbol name 
V—symbol value 
T-symbol type 


name: 

=04RRRR02NNNNNNSSSSCCCCCK 
R—ROG size 
N—name 
S—RAM size 
C—COM size 
library mark: 

=01000L03CK 

L—1 = selective load on 
0 = selective load off 
there are only 2 possibilities: 

=01000003FC -off 
=01000103FB -on 

Mode Encoded ASCII 

Mode encoded ASCII is a schema for using the rest of the 
information storage capacity of an ASCII character while stor¬ 
ing hexidecimal information. Normal hex coding uses ‘O’.. ‘9’, 
‘A’. . ‘F’ to represent the 16 hex digits. By selecting other 
character ranges of 16 characters, each range can be defined to 
have a specific meaning. The underlying character, after the 
encoding is removed, is the first digit of the value correspond¬ 
ing to the catagory the encoding specifics. The remaining char¬ 
acters of the value use the normal representation of hex data. 
For simplicity and human readability, all mode encoded val¬ 
ues are 16-bit (2 bytes, 4 characters) with most significant 
byte first. Also, no mode encoded data is to fold between two 
data records. To get a full range of relocation counters the full 
ASCII character set must be used. If only upper case charac¬ 
ters are used then ROG allows 64K and RAM allows 36K, but 
no COM is allowed. 

Encodings 

Externals: 

First character is next 3 characters are hex numbers 
from 000H.. FFFH. This allows a meximum of 4096 externals 
in any one module, but does not allow for arithmetic with 
externals. 

Relocatable values: 

First character is encoding value plus most significant digit 
of data value. Next 3 characters are low 3 hex digits of data 
value. 

relocation encoding value 

ROG ‘G’ (47H) 

RAM ‘W’ (57H) 

COM ‘g’ (67H) 

This table shows the first hex digit as encoded as each 
relocation type: 


Data 

Abs. Hex 

ROG 

RAM 

COM 

0 

'0' (30H) 

'G' (47H) 

•W' (57H) 

'g' (67H) 

1 

•V (31H) 

'H' (48HI 

'X' (58H) 

V (68H) 

2 

•2' (32H) 

T (49H) 

'Y' (59H) 

V (69H) 

3 

'3' (33H) 

•J’ (4AH) 

'Z' (5AH) 

'j' (6AH) 

4 

'4' (34H) 

'K' (4BH) 

' (' (5BH) 

'k' (6BH) 

5 

'5' (35H) 

'L' (4CH) 

'V (5CH) 

'1' (6CH) 

6 

•6' (36H) 

'M' (4DH) 

'] ' (5DH) 

•m' (6UH) 

7 

'7' (37H) 

'N' (4EH) 

(5EH) 

'n' (6EH) 

8 

'8' (38H) 

'O' 4F H) 

'-' (5FH) 

'o' (6FH) 

9 

'9' (39H) 

'P' (50H) 

A '(60H) 

'p'(70H) 

A 

'A' (41H) 

'Q' (51 H) 

'a' (61H) 

'q' (71 H) 

B 

'B' (42H) 

'RM52H) 

'b' (62H) 

V (72H) 

C 

•C' (43H) 

'S' (53H) 

'c' (63H) 

's' (73H) 

D 

■D' (44H) 

T’ (54H) 

'd' (64H) 

't* (74H) 

E 

'E' (45H) 

'U' (55H) 

'e' (65H) 

V (75H) 

F 

'F' (46H) 

'V' (56H) 

T (66H) 

V (76H) 


Page 16 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 22 


72 


Common Relocation Resolution 

ca) COM relocation is handled by a mapping process, where 
each module’s COM segment is distributed over the actual 

COM blocks for the whole program. This is distinctly dif¬ 
ferent from ROG or RAM segments where each byte 
allocated gets a different memory location. In common 
blocks, all block/segments with the same name get placed 
in the same memory location. 

cb) The only entry symbol related to a COM block, is the 
COM symbol. Its value is the length of the COM block. 
No other entry may exist for any COM block. 

cc) Since COM is a relocation type, program references may 
specify offsets into COM. Any symbols within COM are 
local symbols and are mapped at load time, as is any 
COM data. 

cd) Blank common, if it exists, must be the last common 
label in the symbol table. The predefined name ‘?*****’ 
is generated for blank common. 

ce) The COM size specified in the name record is the highest 
COM relocation value used in a program (including space 
reservation by DS). The size of blank common, if any, 
is determined by subtracting the cumulative size of all 
labeled common from the size in the name record. In 
other words, the size in the name record ‘hangs’ over the 
end of labeled common by the length of blank common. 
The actual value of the bcom symbol (*?*****’) is 
ignored. 

cf) Labeled common blocks must all be defined lengths and 
must be the same size in all modules. 

eg) Blank common may vary in size. The loader will allocate a 
block corresponding to the largest blank common block 
specified. 

ch) Common module relative is mapped from one relative seg¬ 
ment, in a module, to appropriate memory addresses 
based on order and size of common blocks. Each common 
relative reference is given a COM value based on the offset 
from the beginning of its common block and the total size 
of all preceding common blocks. At load time the process 
is reversed to yield an offset relative to the start of its 
common block. This offset is then added to the actual 
start of the block in memory. This way all references to 
any common block, even in different modules, get mapped 
into the same absolute memory address. 

ci) To resolve a common reference: first determine which 
common block it refers to then resolved value: = common 
block absolute start + (reference-reloc. com blk start) 

Example of COM mapping 


module 

symbol 

length 

COM rel absolute address 

module 1: 

COM1 

10H 

0 

1000H. .100FH 


COM2 

20H 

10H 

1010H. .102FH 


COM3 

15H 

30H 

1030H. .1044H 


(bcom) 

20H 

45H 

105CH. .107BH 


nsize 

65H 

(size 

in name record) 

module 2: 

COM2 

20H 

0 

1010H. .102FH 


COM4 

18H 

20H 

1045H. .105CH 


bcom 

12H 

38H 

105CH. . 106DH 


nsize 

4AH 




MEMORY —» 107CH (next available location) 


Notice both modules’ blank common are different sized. 
After all modules are loaded the largest blank common size 
is used. The next available byte is defined as ‘MEMORY’. 


Note the way COM2 has different common relative addresses 
in each module, yet both are mapped into the same absolute 
address. Also note the gap between COM3 and blank common 
where the loader allocated COM4. 

Optional Formats 

There are a number of features that might be nice in a 
relocatable format but are not included here. Some are 
necessary for machines other than the 8080 line, for which 
this format was designed Others are a convenience to 
programmers that lead toward bad programming practice 
(specifically externals plus offsets). To allow for future 
flexibility, it was decided to specify how such additions 
would be added to this format and a way of telling the loader 
to expect same, or screan foul. The ‘option select’ record is 
used to indicate target machine and active options. For one 
pass compilers and others, a general fix-up record is specified. 
These are suggested options and are not final, please contact 
the author with suggestions! 

The major deficiency of this format is that all relocatable 
and external data are assumed to be 16-bit values. The Z-80 
has an indexed mode which can benefit from 8-bit externals 
and machines like 6800 & 6502 require 8-bit values for 
indexing and page zero addressing. As such, three schemes are 
provided to handle these: using the fix-up record, using the 
high 32K of each relocation range encoding and adding an 
extra byte on 8-bit references. The most desirable is using 
the high 32K because the consistency of the format is 
maintained—each input byte translates to one output byte. 
However only 128 8-bit externals and a split page zero relative 
encoding result if more than 128 bytes relative are required. 
If a flag character is used (such as the on a 16-bit external) 
then no such problems occur, but the format becomes less 
humanly readable because the flag byte gets totally thrown 
away and not passed to the output. The fix-up scheme used 
on large computers totally destroys the primary goal that the 
relocatable format will be directly humanly readable, and one 
might as well use binary. 

Option select (type 4) 

0 . .2 ‘= 01 ’ 

3. .6 bits specification of options selected 

(lsb) 0—non 8080 machine (default is Z80 

and 8080) 

1— use of high encoding for 8-bit data 

(max 128 byte page zero relative) 

2— full high encoding (256 byte PO 

relative) 

3— fix-up record allowed 

4— record count record allowed 

5— flag scheme for 8-bit data allowed 

7. .8 ‘04’ (record type) 

9. .14 machine type (ASCII name, right filled with **’) 

8080, Z80,6800,6502, 8085 
if other use, standard name of machine 
15. .16 checksum 
Record count record (type 5) 

0 


1. .2 

number of counters 


3. .6 

overall checksum of all record checksums 

7. .8 

‘05’ (record type) 


9. .10 

number of type 0 records (data) 

11. .12 

>5 >» j >1 

(symbols+eof) 

13. .14 

2 

(name) 

15. .16 

3 

(library mark) 

17. .18 

4 

(option select) 

19. .20 

5 

(record count) 

21. .22 

6 

(fix-up) 

23. .24 

checksum 



Number 22 Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 Page 17 


73 


The record count record is allowed to add to the security of 
the system. It allows checking that no previous record has 
been lost because of errors. Each count is an 8-bit, carry 
ignored checksum of all previous record checksums. No 
attempt has been made at error recovery, just error detection. 
One implicit feature of this format is that intuitive error cor¬ 
rect can be made, if necessary, by the human operator. 

Fixup Records (type 6) 

0 

1. . 2 number of fixup items 

3.. 8 ‘000006’ (address and record type) 

(9+len*5). . (10+len*5) fixup items: 

< A AA A > < DDDD > < TT > 
where: A—fixup address 
D—data value 

T—fixup type: 0= 16-bit value 

1 = chain resolution 
2=8-bit (hi byte) 

3 = 8-bit (lo byte) 

Both address (A) and data (D) are encoded ASCII (MSBy 
first). The type indicates fixup required. A chain indicates the 
target address is to be filled in with the data vluae, but first the 
contents of that address are to be kept to point to the next 
address in the chain. A value of zero indicates the end of the 
chain. Otherwise, the data value is added to the current con¬ 


tents of the target location. This also allows arithmetic with 
externals, as the data value may be an external. On 8-bit data, 
the arithmetic is done with the 8-bit contents of the location 
and the requested byte is substituted in. 

Optional Encodings 

The high 32K of encoding is reassigned to 8-bit values, on 
the assumption that no modules that big will be generated. 
This is largely valid, however, it is conceivable that a relocatable 
object module produced by combining other smaller modules 
could get that big. 

Reassignments: 

O (4FH). . V (56H) - page Zero relocatable (00H. . 7FH) 
W (57H).. (5FH) - 1 byte externals (must be first in 

serial sequence too) 

o (6FH). . v(76H) - page Zero relocatable (80H. . 0FFH) 

If 2 byte values describing 8-bit data items are to be 
allowed, then the first character of the 4 character item is a 
flag. The remaining 3 then contain the hex value desired. 

Flags: 

‘! ’ (21H) — page Zero relocatable 
(22H) — 1 byte external (lo byte) 

‘ # ’ (23H) — 1 byte external (hi byte) 

‘$’ (24H) — 1 byte common segment reference 


F- F- 
*-« 
> X 


r x 
J 
C X 


2- CL 
X _J X 
J O u 

a 0* c 

•- X O 
x CL _J 


0) > C UJ 

z x cl 35 
x x f- z> 

■r- > (/• 

x Z C 
X X O 
actii 
o -• ui —« 
a > a 


ill O CO *-• 
1 Z ill u 
O - J) 
-• O F- C 
i.O Z -< 
x - _j a 
a x *-* uj 
u a a 
h ill C O 

o x cl o 
z o c z 

O aJ 

07 X 
■ Q a aJ 

x c a 

F- X O G 
~ X _J E 


UJ uJ 
E E 

O O 


O E 

O c 
X X 

X X 

o o 

lL X 

07 07 
07 07 

UJ UJ 07 
X X J 07 

a a c _j 
a a z c 
C C X z 
UI X 

a a - uj 

c c X r- 
OOaJx 
_! _J UJ 

O O O X 

z z o 

~ - X 
r- r- UJ UJ 

x x a j 
< r c e a 
i- »- 5 <r 

01 0 ) Z h 


x a 

O X 

o o 

UI u 
X UJ 


X 


X _J 
UJ _j C ' 

x o x 

UJ UJ UJ ( 


UJ UJ UJ C 

-I 


-I z 
z o 

07 O *-> 

z 


x a c 

UJ t 
h- c c 


X E O 

o c <r 

O X UJ 
uJ CD 
X O X 
X o 
C X X 


G Z X . 
_l uJ UJ « 

uj i f- : 

X H x 


a 

X z 

O X 
U D 


X « - O 

uj a a 

H- - 07 

x a: x 07 
uj o o uJ 

. o e a 
x o <i a 
c x x c 
E II II li 
II o UJ _J 
c ui a i 


<r o 
e <r ► 

X UJ > 
O L 


J > O O H (S 

a a x 

C Jhhh 
H Cl J x X x 
~ H ul UI UJ 


UJ 0) 
7 r- — 
: O O 
i <r x 
. X X 

: c 

: i _i 


j > 
:• 07 o 
j z x 
x i- 

E Z> 07 

j x a 
J X 
: > 
X <x 

j Z E 

F* F- 


a a 
c c 
O O 


r- X Eh 

x £ c; 

X “7 Z l 


-I 

C 

OX 


i <J J x 
. - X c 
: jo:r 


a o 

X X _J I 
Z Z I O 


a 

_j > 

I o 

0 7 T. 


> J c 
O I F- 

£ O) 07 


ooo 
o o o 


o o o o 
o o o o 
O O D O 
o o o o 


bbboooooooooooboooabboooobooo 

^ -v ^ o r. /-j r , n rt r\ n n 


OOOoOOOOOOOO 
o O O o o ooo O O OOGOOOOOC 
OOOoOOOOOOOOOOOOOOO 


O OOO OOOOOOOOOOOO 
D o :> O O O O G O o o o o o o o 

OOOOOOOOOoOOOOOOODOOw^vtwuuuuvi 
.-7 o.-7 -in.^oooo OOOOOOOOOOOOOOOOOOO 



Page 18 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 22 


74 


0014' i IGNORES ALL ERRORS UNLESS USER 




z . 

_i o o 
I ~ 


> H 
C Jj ii. 

W0« 


uj £ 
I > 

rh 


c c 

z 

• J Lit 


1ZU 
•- Cl 

a o 

0; r- o 
Ul H 

2 o 

— X 

o »-• 

Ul 

a 

a 


Z o. 
a r 

x 5 


_i _j 
a c 
<r >- 
h x 


> X 

Cu LU I 
ui h- 
CJ 2 ~ 

* «3 


<r 

' x 

O 01 

N 

II o 

A O 

x »- 

<i 

i > 
O X 


o x 
_j o 

LU 

X H 


O D 

a: z 

v C 


LU X 

> O 

c a 

01 


x x x 

I lU LU 
U I I 
DlOhO 


X x Ul 

I UJ X 

(J X C 


i a a o i a <x i q 


'># 


«■ cs $ 

O x _J + x «m 

' a a a ' a x ' _j 

OLUXCU.IOZ2CUJ 

n x o x x o x v x 
oi a: 


x i _i _i 
W o) _J _J 
j 3 C C (J 

x x o o i 


-i 

_J <T Cl 
c x o 



<SJ 


a 

a 

a 

a 


(J 

o 



a 

3 

> 

X Q 

UJ 

X 

x a x a 


O LU 


— M 

X z 

-j 

c 

_j <r x o 
c a x z x 

5 

a a q 3» x > 

I «I c o z o 

X X »- 
> o O UJ 

a 

UJ 

X u 

- (J 

X z 

D IX 


X (J O D X 

a 

oiao)ax>xa>> 

D<rocooo<roo 


X X 

Ll 

O 1 

o 

O _J (J “1 _J 

o 

u 

a a a x *-4 x 

r x x x 

X 

O 1 

O 1 

oi a o 

£ 

o “i a oi a 

i— 

a 

XOXOXXXDXX 

X X X X 


cc c 

UJ -< 
01 x 
D UJ 
X 
•. a 


~ M CO *0 O' 
*0 >0 *0 *1 *0 
o o o o o 
o o o o o 


8 s; 
\ \ \ > 
o a ll < 
"*) »o r 
o o o •: 
o o o < 


i o o o o in oo 

. N f-» N N 

>000000 
>000000 



oo a a *■* cj in 

N N 00 00 CO 

o o o o o o 
o o o o o o 


__ _ - - h 0> » Q U -« -« O' 

iilUOUQ«UJOv<r CluJQU 

\\\\\\\\\\ \\\\\\\\\\\\\\> 

Nr^0'OOaJ«^^^C4in<0 0'<ra>OQUJULiL^C<01' 
ccccccaiJJcaujjffljjuaaajaiaMajjcjL 
OOO000000000000000000000C 
OOOOOOOOOOOOOOOOOOOOOC 


c V -O N 

CJ O • J J o 
o o o o o 
o o o o o 


Z UJ - 

Ul > X 

x _| _J X t- X 
uJOL-Oul x Ul UJ 

X - Ul 01 X a I 

ociujocziaoacQ 


-J 01 -J X _J 
J>CUJJCNU)JO.> 
COh-XCXZDCOO 
OXOIQOO’jClUCLX 


U 00 

J X 


§3 

X X 


(J 

LU 

E 


x <X 
O H 

as 

. *« 
UJ 01 
UJ CC UJ 


38 

5d 


<r c 

a X N 
-J o cc 


UJ O x 
I - uJ 

o c c z 


J3CN 
C O X Z 
0X00 


UJ 5 

x 5 


3> x 

o z 

X >- 


X M 

o z 
a o 


A X 
V o 
-J cc 
C X 
H UJ 

o 

r- Z 
UJ 


CJ 


X _ . 

x D K- O 

uJ 01 x UJ 

X iU UJ CC 

O O <1 Z •- 

a 

i 


J C C N h 

c a x z ui 

O _J O O D 
X 


- o 
a ii ii 
uj 

a c c 
o 

O •* UJ 
Z UJ D 
UJ O _J 
_i <r 
JC> 
C 3* ll 

z 

X Q O 

x _| LU 
U O »- 
01 D 
X UJ -J 
OXO 
UJ II 01 
D O 01 
JOUC 

cjw- 

3* UJ 
X Z UJ 
x UJ 01 
uJ U X _J 
X - K UJ 


- ~ O ~ 


o 

o 

C ^ 00 x 

ci a o in 


U C* 01 o 


C- Cl 


sco oa 

ciusn" 


acsci 
o oi a o 


• o o a o 

« - - - CJ 

< o o o o 
I o o o o 


OOlc 

CJ CJ CJ 

o o o 
o o o 


sscaui 

rj CJ CJ CJ CJ 
O O O O O 

o o o o o 


CJ Cl 

o o 
o o 


C) «r c- tf) -0 
Cl Cl Cl Cl Cl 


^^0;CfflaUuuy'JiO-r<r<r r ccNM) 1 )- 1 )CJJiOOOHrc<r<rNCa)aJiJjJ- 
C1 Cl Cl Cl ^1 CO ?) M fo d M |V ' 0) «r «r t r c v v «r c r «r r «r r <r r r m D j3 l/l iO Jl if) if) u) u3 f) f> jl j3 >0 
OOOOOOOOoOOOOOOOOOoOOOOOOOOOOOOOOOOOOOOOOOOOO 

OOOOOOOOoOOOOOOOOOoOOOOOOOOOOOOOOOOOOOOOA^'-''-'^' 


^ ' <0 <0 <0 -O <0 <0 *0 

O O O O o o o 
o o o o o o o 


Number 22 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 19 


75 









AD INFINITUM IN THE GREAT SOFTWARE 
PIRACY DEBATE 


D Q CJ 

o ci a 

a o u 

•i U. cj 

a go 

J 01 o 

i q o 

I C Q 

a co o 

■- UJ 10 

0 u. u. 

U 05 O Oi 

L Q li- O 

I o o o 

a co u o 

- UNO 

a u. o o 

0 O' N O 

a cj o o 

0 -.NO 

a q o o 

a - n o 

l uj o o 

: — ci o 

I o o o 

S UJ w O 

r MOO 
0 Q Q O 

a r- U O 

I r M O 

a «r o O 

' O' O O' 

: oou 

I « Q N 

a won 

0 O O' "0 

0 <r (J 05 

J —• N CO 

l a co o 

I 01 -5 - 

a o a o 

E O' 05 - 

i' aan 
i n q u. o 

a «■ o co o 

« Cl !D N 'O U. 
r O CJ O U. 

a o o o o -< 

a o o o o o 

i) I/O <0 «-* o 

n a co q u. o 

I Cl Cl Cl Cl o 

a o o o o o 

j — Ul Ul — O 

- O O 


incooac 

I Ll — ID UJ O L 

i iO O O' Ll CD L 
.05-0 O' Q C 

: o o cd o o c 

- N C Cl — iD • 
' WMUQUJ' 

> o —* o —< a l 

) O -O V UJ iL L 
IhOW-OC 
) CD O U. O o c 
1 <E Q O' UJ C < 
) M O a M Cl c 
J O «r — «0 N - 
. C D r ill £ 

> O' O —• O *0 L 

> O CD UJ Cl Q C 

> d Cl U. UJ CJ c 
5 v O C C C 
j -< Cl O O' o c 
) Q a O CD c 

. — a o O' <z < 

. >i)h(DOQC 

> O Cl a O' N L 
) CD CJ CJ Ll -0 L 

i a o co o uj c 
)ONM5U.f 
li/lOOC'.C 

. o in cd ci a ? 

> + o c u. o i 
) M o a U. O L 
I O C c LlM C 
J CD CJ CJ U. (J C 
' Cl N O H M . 

) cj a cd o u .: 

> n co aoio* 
) a ci o oi o l 
i - - o o c * 

. -4) N O CD Cl < 
)OhOCINL 
lO-OOQrf 

i a o a 0"0 c 
i cj cd cj a a < 

1 O a iO Ll N ’ 
J O CJ UJ Ll C * 
■ nrinooc 
. CD —< a CD CD < 
) Cl O <T C Cl * 
) CO CD - CO a L 
I O' Cl O O' •*> c 
J N CJ CD Q ID « 
) —* N CO O UJ » 
I <0 a CJ CD Ll C 

) o O' uj a c c 

I CD N ID CJ O' U 

> a - o o o c 

> CJ -0 CD O CD C 
)-OflOC£ 
J O CD (J CD a c 
) a n a n u 

) CD O ffl CJ v C 

* o o o o o < 

> o o o o o c 

> a o c a >o u 

> — 05 ID N O' 0 

> o o o o o c 
i o cd a o cd c 

I UJ UJ UJ UJ U. J 


V o o 
O' O O' 

O CD O 

- a n 

WON 
co O' 'O 
«■ CJ 00 

— N — 

a n o 

0 . O - 

aan 

o OS - 
O Q CJ 
a Ll O 

o n o 

ITfS'JL 
UJ-OiL 
O O O - 
o o o o 
id m - o 
a q u. o 
o o o o 
anno 

M J - O 

-I - - o 

ll tl I II 


Received: 77 Nov 25 

Here’s my contribution to the Great Software Piracy 
Debate. The main facts are clear: software is very expensive to 
write, moderately expensive to market, but reasonably cheap 
to pirate. Good software is therefore rare and piracy common. 
Can this be corrected? I think so, by making piracy—or, more 
precisely, copying programs from a friend—profitable to the 
author of the program. Here’s how it might work. . . When 
you copy a program from a friend you send a small royalty 
($ 2 . 00 , say) to the program’s author, who included his name 
and address in the program itself. This royalty buys three 
things: ( 1 ) the right to use the program, ( 2 ) a complete set of 
documentation by return mail and updates later, and (3) 
the right to claim certain rewards from the author. 

The right to use a program would be valuable for a lot of 
us who want an alternative less expensive than the local 
computer store but less underhanded than piracy. 

The documentation would provide an extra incentive. 
Remember that printing is still much cheaper when you’re 
making a lot of copies. Of course, this would also be an 
incentive for good documentation, since the other kind 
wouldn’t sell. 

One reward which should be available is one for demon¬ 
strating and correcting a program bug (defined narrowly as 
a failure to meet the published specifications). Of course, only 
the first corrector (as determined by postmark) would win 
the reward. Other rewards might be for adapting the program 
to a new operating system or hardware configuration. 

I’m tired of reading complaints about software pirates 
and have tried to find a practical cure. Does anyone have 
a better idea? 


James R. Van Zandt 


— O -« H 
Cl O i E (J D oJ 
OlEOUI 05 X 


X 

U U U U H 0) 
—I —I —1 -J Z D 
X X X Cl' <L a. 


Z X 

a: uj <r 

3: aJ H UJ 

O > > _J 

JO 05 0 

II (J ll II 


E 

D E 

05 !D 
X Or 

X x O ^ 

i uj <r o w o <x 

U X ID . - X . 

Oh«aUQ(JiSuIEE 


_i _J — 

j ~ a > h- 

CCZOaOMUXQOUJ 
OOClCEEi-JCEJC 


CD 

£5 

_l CO 

<0 x 

J Q u 
C X UJ 

: z z o i 
« - X u o 
) CD UJ Ul 
« — H X CD 

: x x z 

) O UJ LLl 

X z 
) z x o z 
iCChD 
: X E 05 X 


UJ ID — <=' H 

- ID O' CO ^ £ 

o o o o £ 9, 

O O O O O 

CJ Cl * * * * 

X W Cl «■ * * 

r- 1- X x x — 

XXuJiU ^ 
UJuJXX 
Z Z CD CD a 


> 00 CJ O' £ 
) Oj C 5 Or O 
IOOOO H 

> o O O o o 

AS' 1 - ' Y 

* <r ui * * * 

j _ (V) X * r 

. X X x O D 


c uJ UJ uJ _J 0) 
ill iiiu: 
l CD O Q <J 


j 0 -. D M H M 

) o m o uj o 


I if) <0 W O' 0- £ 
IDDDaiDui 
> 000000 -' 
> 0000 - 00 -: 


fli HZ. 

<r .. x uj z 

t- O -• Ul _J D 

h J J x OW 

x UJ UJ C Ul X 

. UJ X X Z X CJ 


O » M N It O' O 
O «r N C O X v-< 

o o o o o o -« 
o o o o o o o 

V N N N s ' 1 - 

* > * * * ^ z 

* til —< CJ —• C uJ 
X H X X X r— _J 
I x uJ UJ UJ t~ O 
U Ul I I 1 X aJ 
CD Z CD CD r- UJ X 


> ^ O') O') *0 N 05 O' D' O' O' OJ Q Ll O « Cl 
. Ll ll : x Ll -_l X a. X X U. X a. a. O O O 
> 0000000000000 --'- 
>0000 00-0 000000000 



» o o o o 

1 c iD *<) N 
I Cl Cl Cl Cl 

. o o o o 


o o o o o 

05 o 

Cl Cl Cl Cl Cl 

o o o o o 


Page 20 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 22 



















BITS ON BOOKS AND A NIP AT NIBL 

Dr. Dobb’s Journal of Toothsome Topicalities and Unscrewed 
Inscrutabilities 

Dear Mr. Warren: Received: 78 Jan 30 

About a year ago John Craig mentioned in Kilobaud that 
he had lost his favorite reference book, which turned out to be 
a manual for the CDP (professional Certificate in Data Proces¬ 
sing). I found out from my favorite computer bookstore that 
there are three such books, and some students buy all three for 
fear of missing out on something; apparently they don’t under¬ 
stand the difference between representative questions and 
actual questions. If you have someone up there who has done 
the CDP recently you should have him review them. There are 
manuals from Anaheim Publishing, Arco, and Petrocelli- 
Charter. (The Petrocelli-Charter 2nd edition comes in two 
volumes, one for Petrocelli and one for Charter.) 

The bookstore, incidentally, is worth a mention. It is brand 
new (started last summer) and is an offshoot of a local 
computer store and electronics manufacturer, OpAmp Com¬ 
puters, in Hollywood. It’s called OpAmp-Technical, 
1033 N. Sycamore, Hollywood 90028. She has more computer 
books than Cal Tech, UCLA, USC, or Technical books in 
Westwood. ( She being Mrs. Lyn Karch, the daughter of the 
computer store owner; it’s her business, not his.) She also 
has books on engineering, math, general electronics, film 
making and such. 12 noon to 5:30, Mon. thru Sat. 

One book you should check out personally is: Micro¬ 
processor Programming for Computer Hobbyists, by Neill 
Graham, Tab book no. 952, paperback, $8.95. I almost fell 
for it. It purports to be a book about a high-level language 
that can be used as a substitute for machine language. The 
chapter organization follows the outline of a typical college 
text on programming, such as Ward Maurer’s or Donald 
Knuth’s. But there is no bridge between the “high-level 
language” and the machine language; at least, I couldn’t find 
one. And the “high-level language” is PL-I. 

You owe your readers an explanation and apology, even at 
this late date, for some of the obscurities in the source listing 
of NIBL. Particulary if the version in the collected Vol 1 is 
unchanged from that in the Nov/Dec 1976 issue of DDJ. 
Neither Mark Alexander (corrections in April) nor Jef Raskin 
(review in May) picked them up. At addresses 015E, 0303, 
04E2, 05D0, 05E7, 064D, 0772, and 0909 there are instruc¬ 
tions with the mnemonic JS and the hex code C4.1 have two 
SC/MP manuals (Technical Description, Sept. 1976; Micro¬ 
processor Applications, Oct. 1976). Neither one mentions a 
JS instruction. C4 is the hex code for Load Immediate. 
Further, there seems to be missing code, or kludges, or both, 
at each of the above addresses: four bytes at 015E, four bytes 
at 0303, five bytes at 04E2, five bytes at 05D0, four bytes at 
05E7, five bytes at 064D, five bytes at 0772, and minus one 
byte at 0909. Most of these are jumps at the ends of sub¬ 
routines. I strongly suspect that the program as published 
won’t run. 

I happen to be a Dijkstra freak. If NIBL is typical of 
commercial software, I have another excellent reason to 
remain one. 

If Mark Alexander is still in Silicon Gulch, and if he let the 
printout get away without checking it, you should have him 
make amends. In Principles of Compiler Design by Alfred V. 
Aho and Jeffrey D. Ullmann, there is a subset of PASCAL 
defined in modified BNF.# It’s Aho & Uhlmman’s idea of 
a term project for a college junior majoring in CompSci. 
An 8080 Tiny PASCAL interpreter done on National Semi¬ 
conductor’s in-house hardware should take somewhat less 
time than a term project. #in LALR grammar form, to boot. 

Has it occurred to you that “Dope Vector” would be an 


P.C.C.’s DAZZLER CONTEST WINNERS 

Far back in the misty past (1976) People’s Computer 
Company sponsored a software contest for a program resulting 
in a new and interesting display using the Cromemco TV 
Dazzler. Qosing date for entries was September 30, 1976. For 
reasons no one here seems to remember, the contest was a 
long time a-judging. All seven (yes, seven) entries eventually 
ran and it was decided to award a prize to each entry. 
Cromemco agreed to issue three additional $100 gift certificates 
and People’s Computer Company will be awarding two $50 
certificates. We will publish some of the programs in Dr. 
Dobb’s-m this issue we are presenting the first-prize line 
drawing software by Gordon French and Greg Yob. —TRW 


Cromemco 

2432 Charleston Road 
Mountain View, CA 94043 

Gentlemen: January 18, 1978 

I am pleased to inform you of the results of the PCC/Cromemco 
Dazzler contest, at long last. 

First prize of the $500 Cromemco certificate was won by 
Gordon French and Greg Yob (Box 354, Palo Alto, CA 94301) 
for their line drawing software. 

Second prize of the $250 Cromemco certificate was won by 
Barry Seip (Electrical Engineering Department, Stanford 
University) for his color-dot-bar generator. 

The three third prize winners of $100 Cromemco certificates 
were won by R. J. Gragg (250 Polaris Ave., Mountain View, 
CA 94043) for his memory tester; Dr. Kenneth B. Welles 
(Nela Park Bldg. 336, Cleveland, OH 44112) for his ASCII- 
3x5 & 5x7; and D. Kleinman and S. Grumette (921 North 
La Jolla Ave., Los Angeles, CA 90046) for their mandala 
program. 

People’s Computer Company will be giving fourth prizes 
to Robert Korody (3131 Homestead Rd. #18E, Santa Clara, 
CA 95050) and David Dameron (402 E. O’Keefe St., East 
Palo Alto, CA 94303) consisting of $50 in books and publica¬ 
tions. 

These prize winners will be listed in the next issue of our 
Dr. Dobb’s Journal. 

Thank you once again for your sponsorship of this contest. 
Best wishes for continued success at Cromemco. 

Sincerely yours, 

Robert B. Jacobsen 
Executive Director 
People’s Computer Co. 


ideal title for that service to physicians? 

And did The Dragon decide to become The Dragon 
Emeritus after Don Quixote Aho and Sancho Panza-Uhlmman 
did him in on the cover of Principles of Compiler Designl 
(No, because Addison-Wesley published it late last year; mine 
is apparently a review copy.) 

Watch those bits, 1046 S. Westlake, #1 

Mike Fern Los Angeles, CA 90006 


Number 22 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 21 


77 



ABSOLUTE!^ 




BY GORDON FRENCH AND GREGORY YOB 

Box 354 

Palo Alto, CA 94301 
326-4039, 325-4209 

A PHILOSOPHICAL RAMBLE 

Our software is a tool for others to use. Rather than make 
a program capable of some special effects and little else, we 
provide two essential tools which make the TV Dazzler a 
genuine graphics display rather than a somewhat quirky toy. 

Once having the tools, no dyed-in-the-wool hacker can 
resist using them. In that spirit we offer some demonstrations 
and hacks which evolved while we were making the programs. 
Bear in mind that our entry consists of the tools, and not the 
rather crude examples of how to use the tools. 

WHAT IS IT? 

The accompanying assembler source listing and assembled 
code in hex is our entry. It includes: 

1) Two routines which plot points: 

DAZL for 128 X 128 BW mode 
CAZL for 64 X 64 color mode 

2) A linedrawer which calls one of the above routines 

3) Miscellaneous routines: 

CLEAR initialize Dazzler and clear display 
DIAG diagonal line diagnostic test 

DRAW initialize line drawer 

Look at the code for the remarks which act as a guide to 
the operations performed. The dot drawers locate the 
quadrant, compute the displacement, locate the byte involved 
and mask to find the bits or nybble to plqt. The linedrawer 
recursively divides the line in halves until dot-level, then 
plots the line as points. 

THE GORY DETAILS 

A) Prerequisites 

The following material assumes that you know a few things: 

1) The TV Dazzler documentation 

2) 8080 Assembler 

3) BASIC 

4) How to load, map and access Processor Technology 
5K BASIC (software #2) available from PTC for $15.00 

B) Drawing dots 

1) Use of DAZL for 128 X 128 BW mode 
DAZL takes as input the cells: 

XVAL = X— co ordinate 
YVAL = Y—co ordinate 
ZVAL = color (0 is black, 1 is white) 

DAZL plots the dot of ‘color’ ZVAL at the location XVAL, 
YVAL on the display. 0, 0 is the lower left corner, and 
127, 127 the upper right comer. 

Warning: If XVAL or YVAL exceed 127, odd things can 
happen. This is usually wraparound, and occasionally things 
blow up!!! It is the driving program’s responsibility to 
check the values. 

Page 22 Dr. Dobb's Journal of Computer Calisthenics & 


2) Use of CAZL 64 X 64 BW or color mode 
This is very similar to DAZL: 

XVAL, YVAL = co -ordinates (0 to 63) 

ZVAL = color (low 4 bits 0 to 15) 

(grey or color depending on mode) 

To the user DAZL and CAZL are very similar. Internally 
they differ because different Dazzler modes change the 
addressing involved. Both routines execute in less than 110 
cycles which provides a maximum plotting rate of about 
4000 dots per second. If you use BASIC, the rates will be 
very much slower due to the BASIC overhead. Typical 
of these programs is 3-5 points per second. If the code is 
entered at ‘START’, a diagonal line will be drawn. This is 
a nice test that all is OK with the load. 

C) Drawing lines 

The linedrawer starts at ‘DINIT’. It draws a line starting 
at the coordinates in cells XZERO, YZERO to those of 
XONE, YONE. The linedrawer calls either CAZL or DAZL, 
so XVAL, etc. are also used. 

At present, the linedrawer calls DAZL. To call CAZL 
instead, change line #1480 to: 

Call CAZL 

(This is at ‘PLOT’ +2) 

These routines let you handle any dot or line graphics. The 
awkward co-ordinates of the raw Dazzler are tamed to a form 
you can use easily. 

D) Point plotting with BASIC 

Now the fun begins. The demo programs are set up for 
128 X 128 BW mode. By appropriate address changes, 
the other modes may be used. Be sure to change the scaling 
factors. If you do not have PTC 5K BASIC, use the facili¬ 
ties of your BASIC to set the values of the cells and call 
the routines. As PTC BASIC is available for a small charge, 
get a copy if you prefer. 

Program 1 

This draws a spiral with a sinewave superposed on it. This 
can make ‘doilies’ and crochet-like patterns. The assignment 
statements of the form: 

X = ARG (Y) 

Pass the 16 bit values of Y to the H and L registers prior 
to an assembler call. The program must then save these 
values in the appropriate cells. This is a little more 
indirect than Poke, etc. in MITS BASIC. 

C = CALL (Decimal address) 

Transfers control to the specified address which must 
be represented in decimal. 

Looking at Program 1, Line 20 clears H and L, and Line 
25 calls the initialization routine which turns the Dazzler 
on and clears the screen. This is called ‘to clear’. The space 
between 5K and about 16K is free for your use in BASIC. 
The loop in line 4000 moves the angle pointer ‘T’ from 0 to 
100 radians. Subroutine 9000 returns a radius ‘R’ with which 
the polar co-ordinate R, T is located. Subroutine 8000 trans¬ 
forms the R, T values to the X, Y co-ordinates used by the 

Orthodontia, Box E, Menlo Park, CA 94025 Number 22 


78 


dot plotting routines. Lines 4030-4040 create the 16 bit 
value, P, which holds the co-ordinates in the form 
XZERO, YZERO. 4050-4060 pass the value and call DAZL. 

To play with this program, see line 9030 for a nice set of 
values. N1 and N2 should be small, around .1 to .01. N3 
should be more than 3. If N2 is zero, you get a simple spiral. 
If N1 is zero, a rosette-pattern is made. 

Program 2 

This makes circles on circles on circles. Lines 100, 110 
turn on Dazzler and clear screen. Subroutine 7000 passes 
the co-ordinates and draws the dot. 2040-2070 convert 
from -1 <X<1 to 0 < X< 127 co-ordinates. You may 
make a circle with the inputs: 

1 , 0,0 

1 ,0, 0 to the input requests. 

Imagine a wheel. On its rim, attach another wheel. On that 
wheel’s rim, attach yet another wheel. Now a bug lands on 
the third wheel. The path of that bug for a given combination 
of wheel sizes and spin rates is what this program draws. We 
call it the loop-the-loop program. This is fun to fiddle with. 
We suggest small numbers for starters. Note that this program 
will ‘fix’ the values so the picture does not run off screen and 
possibly crash. 

See line 1130. Changing ‘G’ will vary the density of the 
plot. High densities are usually less attractive to look at. We 
hope these rather esoteric hacks will give you some graphical 
joys. 


dots/second. This works out to around 20 lines/second. 
BASIC will make this slower. 

Subroutine 1000 starts things up. 

Subroutine 5000 sets up the endpoints and calls the line- 
drawer. 

Subroutine 6000 draws a frame. A simple modification 
changes these to make X and Y axes. 

Subroutine 7000 draws a square spiral starting from the 
center. 

Subroutine 9000 twiddles the endpoints. 

100-200 will draw lines from your input co-ordinates. 

To get here you must start the program from line 50, 
a modification will let you draw a line starting from the 
end of the preceding line: 

185 X0 = XI; Y0 = Y1 
190 GOTO 130 

If you run from line 10, the screen is cleared, the frame 
drawn, and the spiral made. This is repeated. (And may be 
hypnotizing.) 

CONCLUSION 

Here are some tools. Use them freely. If you study the line- 
drawer, you will note the use of recursion and stacks. This 
could be done in other possibly better ways, but the idea was 
a fine bit of fun!! As for the dot plotters, they are nearly 
optimal and stand as a challenge to the dedicated super-hacker. 
We mortals will potter about in BASIC.... 


E) Drawing lines with BASIC 
Program 3 

You may either see a repeating spiral or draw your own 
lines with this demonstration. The linedrawer is under 200 
cycles per dot, so the maximum rate comes to around 2000 


P.S. 1) Do an inchworm or a turtle. Have the BASIC program 
get the commands for up, down, right, left, etc... . 

2) We did not have a color monitor, so no color-oriented 
things here. Take a program like Mr. Yob’s Mandala (see 
PCC’s first games book) and have it output colors to 
the Dazzler instead of splats to the TTY. 



r' <r 
J <r <c. 
•< a: j o 
O i-. «S 
<r .rt (/: <x 
t- i — -- 
i/ .-i n 
Q_ 

I- r> ir u: 
•o 4h 

t r, t— v — 


• >• j. <t 

n n, _j — 
•c. t/i o - j 


. Cw U‘ C. tf TT 

*octo ft- u • 

. O ‘b. ft- G* c-f 

*• <*. 5 •* 1 e 


« — «t — 


>- - or o 
'.•“if* r. 

’ -> i *.> «: 


•x x < z r: n. a: a. 
v- u. — -> o > o 

C I J J fj ti) O CJ o 
1C U (U) fl.fi 40 J 


Ji <? 

C'. c: -i 

x n -x 'j 


' o / it: t» rv fv f - 

,r. O Z O 1 -> Z *J 

i > r o n -) t 


.j 


—■ «c 
f- o 
r: u 


• ts 

• <r 

• M 


- J !• 
X jJ 

_J -o v 


• t- 

• r' 

• o 


h- (5 rr 
>- o u 

O h- -)4?. 
Z. *-• >- UJ 

<r a o ui ui 

I Q O h Z it 

a x — u 

<£ <X. >- CO _J 01 

tr <t 

a. a ui uj -j 

=> 2 > O X X 

•i d 


j j _i _J j j 

— « «r « < < i*j 

• =» • > > > r> <r 

«T Nj OJ K .□•<>- E >- Q 


w <r n x <x n <r j 

!> E- O Q O Q H <1 

*•(/)*. j < n J < n u 


cs u c- tn r.t a o. ir t. um* u ft. tr «; tr " 

t£ tf r- h a .x cr o is. is, — — c tv ft. tr *3 u 

--- —• Oj CV 1- C O tv' O' tV O CVj c. 

r r r. fj c e % Cs. r. r - t_ <• * * c» s a. t -> 


IT 4 . X< e. IP G IT 6 IP F Ifi Ck ir t. M ft ir e» itt t 

e r- ir o) o w r. r —- o wtoKccu'tf'tf’ 

O’ Z. CV CM CV CO CV ft) ¥> ft) ftl ft) ft) ft, ft) ft) ft> ft) ft'. ft) 

ft. r • r . ft. a; e. ft* e; c" ts. tv to ft <s» e. <s ft c. ft ft 


»r u n ft- ft fti ft' 

'T N S’ >| <T T -c 


<r <r it 

< X <T <3 <r <T 


C V Cv v.. O O ' ► 
ft c. u. r. pi cv. <j 


•< (i -3 U Oft — 

« ft. ft P. ft. ft- P> 


— UJ O O C. Cl K) 

ft U U u. u. U. ft' 


t c o rr c f -pcco 

t-’ C C_ Ij. CV c ft. c c U C’ 


uj ft' :»• k — — u r- •one « i. r 
► n ir c-1.. — ft o — o — '' t.' 


- c ut c*> ft <x s c <t tr cv c 

c. c _ c' mo ft ft O) ft « a n o 


C. C G R t f- IT t ft ft ft ft ft <T' <r <r c> U* U. 0 If V rr 3 . U' — 0 O t. C C. CV C V v v a f * C" ft >T ft -X n 'J u ft'- i.v t. ft C.. t« CV ft ft; ft; ft ft. ft. lf> CL O' O C * IO <1 ft- <X < 

r ft tr p p ft r, e-ft'pcftftft«ce'» i ft f is — — — — — — or : c i> t’c r. Oj cv e c e o ft ft k. r r i*. ft k; ft k k ft ft p- »-ft <r v<7-<j-<7<7<T«r<r‘7<r'<Jirirtrtr'irL r 

O t «. tt. ^ f tv- ft ft • ft ft ft) ft) ft ft. ft ft- ft ft, ft. ft. ft. ft. ft ft ft ft ft. ft ft. ft. ft' ft ft ft- ft. ft, ft ft' ft ft. ft, ft. ft ft ft ft' ft ft ft ft. ft - , ft- ftl K ftl ftl ft) K. K, r. KV fti K. ftl ft - , ft 

ft? ft f. t f s t. c. t; f. c v^<rc<i<T<r<rc v <r <j si csr<r<rc<rc<T<rc«Jc <7 c<- c s s <t <r<j<7<7<r<r<j-sr<rsr«i«j s 


Page 23 


Dr. Dobb’s Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 22 


79 


















<T 

CO 


— __ O 

c. ot- 
«j rr cr 

C» U. c£ 


O x 
I- cr 
i«i «t 
u. X UI 


:r « k» 

U. « (i. 

lO L3 «v (U q 


—< r- <r •— 
Z O Q Z 
<i x -a <c 


C. If O 
K' K -1 <? <T 

r~ r- 
IS> 


o - 1H 
ft. ►- UI 

O t'J C' 


ui Cj .s no 


<r*-»'jouor> 

07 J JJ JOO^frhl 
J « l !». cr. i r _J <x o to ' 


tn fr 
••! rc n 

n ■"> <r 

•o x 


(— — u 

r- io rr 
O <t 1«J 
W RJT 

O ■7' -3 

3 —« -J 
*— «T —• 


JCJliJ 

_J cr 
o o <t 
u. ui 

uj •-• :j 

r _= x 

» •■*! f- 


•- z »■• 
cr “» vj 
n o :j 


u: c < 

«. UJu 


> > > 
ooo 

S’ •«: x 


<c f— i— 
U. => UJ 
X O ft 


• n 


o (V x 

»- o ♦ O rr k f- 

" o. (r ii >/i < ir w O —* 

• (iJ ■=> Z >- HI <U rp 7r Z 

n. (Eh aoo J • r~ — 

u. u x cn x >/) u — o. rj 


a 3 C Cl J J _J_I 

— _J -1 ~l JJJ'-'HJJf-Q 

x t. xirx<x<tr>m«-c<i.t,o 

_j_jrn_jtncjov'>oi3cr"- 


t. u cs u< t< u u ir <s if <5 tn c. u u c if^ d t. k>c u a u ^ c Cs- ‘X* <s u< * if< r u. C. U «* tn t. in ir 

if u cr r- t- cc n <r a\ rs i<- — — cu o if k> «r tr io cr- u. an or ft <r p r-cv cm if k <t <t tr it cr 

fv (». f. f- ^ f. f. f- r' a x ;f< x j o i> o » to a. x / x i ff o x> o c’» <r< <"*> ^ o. cr> a t*. n c cu tfc 

f r. h m ic ? *. i c r- *v- t ? r r r ts f i*’ Tj r- rv f ^ r- i f. i -s «?. is. •* e- *■ is- t*: «?> 


U't. IT h U,Mf G IT 5> tf' e, U C. IT f b C- U f 

ir mt aw; <* e is — — cv o 

- * fl\ ^ ff> j, ff I- IS f y, ft, r 4 t 

s * »v d r s — 


u/ cr r- r o 


cr rr {j o 
<r <r <r <t 
k . r nio 
<r r <r <r 


f* * f» K i» ►. r>> * k k r* K K r> K) r 


OK, Uj r u. S. « MJ R- IC b. f; C 1 

u. k e e. u c. h. *4 k: oj ?:• o u, 

ff' <rr a cv k u f: cr -*<rc> «t wocuiior.ra f ^ 

b • li • f»- O C' < C O K; CC W (« lc O y io c O G C f- *5f 

» Cl C* C Co C O l\. (V (• !»’. <3 U' U If- If vr (K O O O U O U* «T. C K If 1C M, a o U. C If MT M b t. — C. C C • 4\ c • t c 

r t.> r.» lhjuu c.' o o cw> o t* o o ir o u o o o c o r. ci o (f o o r n n u* g- g; hi u: hi u h h. h. h f- u h t 

D K. K: »•, K IO K • K, ro K . ► . K K h K) K Kl l> K IO K1 r, K) IT r f, m IO T « h. K' K 1 C K- d h K- fi r l» »• pjt 

cr <i<r'C<r<r<r<r<r<j<r<i<T-cr<r<<r<rs , <'^c<T<r<r<:<r«r<r<:<r<r<rvcr<ir<i<MT«r <: c <r <: <r <i c 


rr 

w H >- 

-I O <T 

M 3 ^ _J 

M l/> If'J Ol 

<r u. ~ < co 

o o >• > -. 

^ • .X) IV) 33 

O O (S Ili.>. 


7D ■=} 
2 O 

•-< 2 

M 

Z f— 

o < 

U Ui 


<t O to 

fS. 'C —. cx <t 

S- CC Cj <t — -t) 


— <X H Q. 

z zm:i/ r 

~ <X -3 X O ~i 


Z -J 

o <r 
—• > 
to X 


• a: c.’ cr '3 
I O M O 
i -I <r J x 
. a a o o 


WHO 
— O -I 
i a o 


I- CM 
»- < 

cr r -c- 
' J cX 

cr> •-« 
to x 
ui 

a <r 




_> >- 


nhX2 
! (I «X 

'-O z ^ 

j|li hX 

rr u. m 
I- O UI HI 

[<J U! < O 
u I t/1 
<T I- 1 - 

O 

O '-J • »- 
JHHO 

n? 7 
• a. «t 
s: i- 
co o to 
rr o z 
— o 

U. X o 


> t- 
>- to 

• I ul 

<X I— 


— rc. CM is. 

aJXhWCltviCV 
• cj<r • *.?S)<r» 

<C C l Q t <t CVi a (E .D 


XXX o 
J J J X 


>- \ -■ G Q J) 


ozzxoz.vx «*. 


• 31 :c o tfi 


I I - - 

— -J-i-J-iO'r «>o 
- xozirooszc<t<i;<i.zz(xo<i 
ui js<Krsuciircrirx"5«orc 


<t —* O Q 


> ►- - C XM 
O Z X Vi o z 

> <r _j q x -j 


^^cS)l^e fc ^^Glr. 8iouinsifiMi.s«,Gine. if\ g- m <s> in & ir i, m t m c ire is it. c ire s» ui ^ u'<h.u. v-u ^ u 

cot^r-trtticr^sc^—— cMCMfOK)^ , 5rircif'W’crr-t^crcof7‘^ir , cc;—^-(\)cv)K)K><T5rir'ifu> u? h h o tr (r> cr. c^ ts. — — p; w r- r> v ^ u' r ^ «?r r 
i')icK'K'K)K)io<T<f<T<j'JT<T<r'f<7<3 , <j ,< g < T<r<T < T<r‘3 - <T<7 , uir<if>if'uciruijXir'ir\b'i/ir ir\ u - ir\ u l. u - m? o cr u c w 'r ^ 'f 1 1 >c cfv^xi u. > 
n ??• « is r k> ts k; !■; es is is n «s «s. e c. k, ts i^. e? csi »s.' «s> Ci e to cs ® <s e? <s. ft. ^ e F f <v«> t f. r *S' ci f e r- it « si i" s e • 


C If Hlf‘ C U H lf‘ G ll ■S lf» fS If- <5 IT I*.. ITi G L G 111 G If IS tf’> C U ■ 
“ *-— CM CM K* K3 <T <T I/C IT \l> \C r- ME ai C (MS C5 P CJ 


rs k is r r i Mt « v j, 


K> K. 

-9- UI 


iS' is ir cr r cv 

<r mv <r & 


x u <■ 

s ^ -r 


Pv (T K Uj (S 

CS <T 5T «/ \C 


U G G IT- U? C- S k S 

k K S C\J <• (S) CM V IS' 


— IS l_l Li, 

Ci. c. r- (». 


cr tr <r t*. k »o 
o b i o <r q o 


<r — — er cifP. *-<no<r-ff' 
M K - k H 'J U CJ H fa - O IS» C- 


-* «r cp u. ii. a u ^ — u. /»• 

n p b' c:.- vi r- .v l* 1 — — — r. ts cr xr t» 


<r cc - <MT r 

r- t-i c.- 


<i<ioii;-*CM'fl'r'r't^t't^r-r'r^r-r-r~r^r~r't^r^f , ^r'p'<io'Sj — c <r p < o d vi r < <r s <r s s p n: <r if o c ui r, - (,»■ ■«? 

iriioif>irii^i^vtotou,u3U3c^ccv:uj»2)«^\^)cf>bCtr^wPc^«^u>t^r^i^^t-r^-r^r-f'CC'or'8cr cr c ir c tr. (?■ n. k or it & c c (T oc 

io K, r. n k. r Ki o rr ki r- io ir, k) io K) io G o io k ki r. K) n>) to k- i-, ci k k) r. r. o r, k> k: k; tn r) r, o k, o r r ro f. k i* r, k r, k- 

^r«iir^^^c^cr<Mr<crv^cr <r <r ^ sr <r <■ <r <r <r <i c' ^ -Cf 


t- a- ff> <t o cn ir m o !«• - o r, ir u u »z: 

<r o- rf o (Too' r*\ cr <r <r <r <I <r <r <r 

X- K K h'-K l*J l»J K’, K h IT 1^- K f- K 1 K !•', 

->r<r«7'crf'ff<T't’-<r<r'<r'cr-«r'C5rf 


Page 24 

80 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 22 












n. a. 

D <X 


<r _J J 

U4 <t 

> <c 
*. :< a 


o .a _i 

j jj 

r x <t 
_i c/i rj 


xr — k; x 


— — k; p} 


■ft! • — 


cv y 


' — V 
J O <£ 
' CL >7 


■ :*j — 

^ i- rn f- <r 

I —• < '7 ^ 

r 

»-• «r o c* o -* 
f; i a a a. a. 


^ y *i S' in <t 

- Cl <r »Qj3X<t •OX* XT 


*-*-:> -J '£.->x M) -i y r> xr > 

X. > O OC Z O Z O X Z. z o *. o 

-J S' V O' <f ^ ~ s: *r <1 — c; — v 


_i 

>• 

■ U. A 


i* 

*” <£ 


SO <r, 
O <r 

o o 


a: 

o </> « 

v e »Vi t 

V V A — I 

— — — JO' 

>•>->- 1/1 
<t 

«* <* v o n « 
z ■ 

cu» c. c* u < 

y y y. >- 

v a v o 

- Ul 2 
>• v V. f_) — < 

a. ■ 

o.- k< <r r* o 

•o '»J 1*1 O' _1 

wi t/> v> u. 

<r <x n 
o o o z >- 
<1 ai 


Vl <T til O 


0 '/) -J 
t C jJ 

JO Z t/> 

^ W O <t 


_J <* A. O i. 


p'- — c - n 

:-j a e> 0 ui 

</> to —• < qvi 

< -T -J _l < <t 

OIOOli. U. & I) o 


— <r «i x < «c r _i <r ►. a 

? u. a; r ?. r ar >. j < oati 

5 XO-J — V. C7->“30 _| O *> *"3 


■n f- 

<£ uu 


X il 
J cc 


t- o 
J 
— o 


* 
uJ <t 

o r 


x o >- 
I- H 
Z 7 Z 


Q, h« H 
=» O =5 
a. cl a. 


cc : j iv 

* uj z k .-q o 

• 10 o • • • 

xo x.x/xs:xs: 


o «- <*i 
71 CC V: 
« UJ < 
X > CJ 


Ci a 

x :> _i _i — t>x>»- 
t>OZOXXXOZOt*J 
f j-mv jw jfHror 


T 
Ul X 

a. 

o cr 

_i — 

cn < 


cn a. 
o n 

a — 


If. if- A. If* 6 * Ifi <V 
•Q-irinififf-r-tr 


ui ^ y . t if c» if* c. u' r u c. ui s it s u \ p. if^ m e: in t u■ it o it Ci tr* a. tr- u. ui m «. H , v» «. >» w ■ — - — -• 

® ^* «* «r. a. — — cv - — oc y kj <f v u'* if n> u> r- a: coff*pw 6 i-*—c , c^»OK)<r^»' 

<r <3 if if. ir if ir in it ir* if* ir in in to w. if if • in in u u* ^ «3 w v w ^ f f ^ if c *f *i> ififur-f*-r-t*-r'-r-r~r*--r'-t'-t^- 


C if <Vi If. C lf\ <9 IT O If. ©« If* C- U ■ ©» U'l «S U Ci. If > 6.‘ If* M 
A. —. —.*.«wiin«T<ru-*if\u?irJC*-r*'OCOl. £T. <t r 
- r-r-r-r-® 


if' -e ir* c if 

•q «r <3 <3 


*c *s < «r if' «r <r 

<r <r <r *j <r <7 <r 


IT IT IT 
<7 </ <t 


6 . o »o U. <f u 

e» u. 10 e e. r- 


u. 

r~ 


rr u. <z cc. r. u/ in 
o <r a k &. <7* o 


CV ISC' t. 

?v e- s b>' 


— if fit u p> x u 1 u. cv ci 1 10 p 
c- — p- <y «<tl mi <r u r- cv r- 


ui t«. w; <r K u w <r k c r </? <r ic 

cv < jr u. il <1 J' x o i' y u. u. o 


tx. If K) !»’ <1 01 — C K' — J 

<v <r cv ■q - cm cv cv r- C' r*- o 


a. a: J or OC 00 JT t* 

<r<rv<T«r<r<7<^ 

v<T<r<r<rc<?<r 


— c ir if if* u n « 
IT IT IT If U' If ir If 
<tsi 

w^«i<r^<rv 


ironu-u. is-cv 

if io«rif ir if if if 

qcq<r<rqq<r 


p. ^ iO if if if if if 
ifififififififif 

<j<rv<r<rq<T'i 

<7<TC<7<r<j<r5r 


if v" «f «r **■ if if <r 
if If if If If flf lf 

<Tcc<7«r<rcc 


tr « n ui u c. ► it 
If If If V Itfhhf 
^c<r<r«r<iX'3 
qqqirctMrc 


(J* c U! - <1 v 11 

r- r- oc cr R> x 
<7 <j <r «r <7 <7 <3 
c <r <7 <r <7 <r <j 


<7 *7 *7 itP X f*OU 

or cr ir or oc ro cr 00 a 

<T<7<7<7C<7<7<7<7 


c r, q if « if i£ if 

<r <r & <r <r <a tr <r 

V <7 <7 <7 <7 <J *3 <7 

q q q q q q q q 


«VG 

; f . ^ 

I «J. *X <3. 




•OJK <t >- ^ 
; »- *X 

: «o ^ a 00 o 
- r- .-3 r- 7 »-■ 

/. Z Y > i. > 
• c — o a o a 
j • —0 — 0 

J • o otl o 


V D C C 

'J <r <r ?' 

<r X tr <t 

• I— 1*1 •— fx’ ►-. I- 

; 1/1 7) q 10 <t w 

<r a. <t o. 

Z ^ uu z 

' o o 00 

j •' x rr>r - 


f>- Y> 
i—■ ■} n 00 . 1 - 

7 - O - n L3 

o n c> q o a 


ilf-O .i 

tc t a- 
C *•.%!« «j <r 
1 - 1 '* » M • 
)»/»*/}<■&>- «J 


-^«rz<r 

O • O » 

Ci yc ^1 >- o ai 


. c _j — c <x (j~i c t> n ■ 
: T xxdOClOOw-iOC.i 

I O w J J <■ J VO _J X _1 : 


*t j. .Li 

*> o o 
U X .c 

—• r.‘ a x n ii 

•t H O U. <t “v. 

a. CL t— C., h* 

It X Sj) tc. 

J n 

\ O — H- 

t <t 3 -u O ? 

l- a. O -XX 

r- c/ <r _j a t' 

<c m o I— H- 

' . _i v v* r 1.1 

- J \ 'll «j •=> X 

-OX o tf 


00 O 0 

■ 0 • • Q M 

. * 7 i u x _i n j) 


— j 

■ a — 7» T. h _l T . 

av or-z.xn._xic 
IQ J * V. 7 Jf/li 


u v >- 


on n 

<. <x 


i - Z 
1 o —• ' 
r t> i 




'•J «i J •- 

tc Z c.» c 

ft z »-• 

« /i M 


U‘ C 3 Vi _l 

• • JO 

c > >t r u. j 


p — — 0 r 


a c u‘ •. t 
rqq iol' if ifht a 


1 Cv 0 cv c - c\ c. o a <\ ;v cv c- 0 o’ ui. cv cv c« 


a o ■— -> x 7 - y- r> > r»r>.r 
O O z C ? S> O O O - 
ft O. _J I —• f 


t- U‘ »S If *\ L* •* U *> U. C 

r< i*. - - ci cv r k q q «' 

x: H K; Kx M fO K| Kx K. P f* 


uJ Q > 
Ul 'sJ 
< Q J- 

z n 

UQuJZ 

o * <r 
H C W X 
O *- 
«t • X • 


< -J C x r a. 


o <s cr •-* > x n tn 
z vz> OU.TD 
-a 0 •-< v v c <c a 


lf> Ml! & Ifi If* P" 
« — — <\ cv o k) q 
qqqqqqqq 


•r 

■q 


A 

t. 


IV u 

<7 PV 


- rt r — <t r <u. u <rr cl ui 

L\ *} C . *• «•- -4 I*. U i^U. q k. q u 


— C“ — 7T " U C r (T ?* 

c y i< <»* o c u o 


r- c 


► • c K f, c 
c f- c t r- sT 


1*. u. c 1' - 
r u p • r 


— cv cv* u. o ui cr ic m 
<r •* c i« r cv r o & a 


Cv c c c* c. C*l r. cf IT ' L 

UUL Ublcbtx Ii (1 U li 
KU, K C P K~P.K K"P P ►. 

qqqqqqqqqqqq 


u. L" p ^ u a c t_- c 1. c*. u 

UPAtqprpt. atp 
r q q q q q q s < q q q 

qqrqqqqqqqqq 


— c. tr v r* <r n u u u 1, u 


q qqqqqqqq q s q 
qqqqqqqqqqqq- 


«. u (• u- L b. 1* 1. u r — <3 

— — — — — — — — —c cc 

q < q q q q q c q q q q 

qqqqqqqqqqqq 


u v r 0 c <i a c, C - p -3 u‘ 
CfCOCOCCOPP P P 
qqqqqqqqqqqqq 
qqqqqqqqqqqqq 


j f <7 o Cv — cv q if- if r- 

p- pp P''<r^< 7 ^ , «r« , qr 

q qq qqqqqqqq 

q q q qqqqqqqq 


Number 22 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 25 


81 


COl'i&INED 7 ALU 













'JQ «J 

- <r x 
1 f- <t 


j 4 xjj jr 


T> O O d 

O O O D 

I— I- I- 

«r ^ a. — — 

x u- o x >- 


<t it) Q < X > 

ai< e nu j. 


—• r- x. r» —• t) r> v r» o :> r> *-• :> x > a 
>CZ0=»^>0I'0Q00=>0^10? 

t ?: m r »■ w f < *• r r >: *- r -a 


6-uMf M-F. U'SU l*. IT P b P. IP ft. •» ^ 

P P on cr cr CT P r —• ~ CY C\x x <7 <7 ir lf> vf 

— ~ —-tv <x* tv. CV. IV P C'J C 0. CV Cl IV CV. 

cv cv tv c cvi o o: o cm c\ o cv* c a cv a c o c 



• 


• 




_ 











• 

• 




























o 

o 

c 










• 





























or. 

X 

X 










• 





























o 

o 

o 










• 




Id 

























3 UI 

o 

o 










• 




u 

























»- 

u 

o 










• 




< 




l— 





















UJ < 
















a. 




M 











or. 










tn T 












• 








cr 











<r 










<t — 

X 

3 










• 




>- 

























a o 

o 

\ 










• 








o 











>- 










O tr. 

_» 

x; 










• 




-J 




< 













z 








O 

o 

_J 










• 




CL 




J 











.J 










t/i o 

CJ 

X 









— CM 

• 




(/) 




u_ 


• 




















c « 










• * 

• 










t 









*/) 










X 












• 




Q 




J 


z 











-J 








o x 

>- M 

N 









a: rr 

• 










o 






























o o 

• 




u_ 




«x 


>: 



















1- f- 











x»- 

• 




o 




r> 


r 

_J 








cr 


o 




<t 




V) « 











<r <t 

• 








** 


o 

<t 








fd 


u 




t ti 




LxJ 











o o 

• 




Q* 






o 

O’ 








_J 


cr 




cc 




a x 


U< 

'-xl 









• 




Q 




<c 


t 

X 














•X 




E rr 


1- 

1- 








o n « 

• 




O 















p; 










UJ 3 


<t 

<X IV 

■s 

—■ 

— £\l to P 

p} 

<T 

<1 

«: z a. 

• 




*t 




<c 


to 

k- 








< 






l«l 




P* O 

1 t 

T t 

z 

X 

>■ 

X 

>- x V- X 

>- 

> 

y 

—• ■— i- 

• 








o 


_l X 








o 


cr 




o 
















• 




1- 






X 

SI 














<r 
















• 




fT 






n 











b) 




cr 




X 












• 




cr 






o 






a g. 


X 


3 








(?: 












• 





<s 


T 



_J L- 



.1 J J H J 

<• X 

X. 

rr Ci 


< 


























<* 

IP 







<t 

<r 

«rri' 

lUf- r> 

<r p-j 


or 




t r 




cs. 












• 





ir 

:*J 

—J 

4T 


CC 

U i 



> 


“> f- cr _J Uj 

d ir co 


CO 








p. cv 




« 

«s 

c*. 

IV pv p. c. 

ts 

C4 

t 

l at; 

• 





<T 

O' 

*t 

VC 


z 

_l 



X 

>- 

o. WO 

u to 

p n «r 






•J} 
















• 










—• 

■r 










ul 




Z. 
















• 










J 

A 










z 




















• 










c 

-J 






























• 










_J 











J— 




<x 
















• 

<x 




=J 

—> 

rr> 

rr 


-J 

cr 

r/> 


y 

s~ 

J E J 

* r 

y 

V. -' 


m 




rr 




3 O) 

.Tl X 

X 


X 

u‘ 

m 

til oi a a 

ro 

tC 

.o 

x a, u 

• 

tl 



» 



rv O’ 


o 

r> 

i 


o 

O 

o o o o o 

o r> n 


o 




o 




o o 

o a 

a 


Q 

c 

o o n o n 

n 

o 

Cl 

n p a 

• 

tr 



Q 

f.' »d 

UJ 

UJ 


u 

<r 

<t 


o 

u o u o 

y o 

u u ui 


cr 
































or 













uJ 





















0. 





Id 

« 

tr 







n 


tr 




T. 




X 




o 

o 


hJ CxJ 

o 

U- 

— o 


<x 




O 





Y 

UJ o 







i.0 


►-« 








p- _J 

-J -J 

o 


cr 

rr 

t*j 

Ui O O P 

rr 


* 

«•> C" >- 


*■ 



L. 


'i 




<t 

• 

cr 







<r 


y 




_J 




O «t 

<t <r 

o 



UJ z 

T l* 3 T 

T 

c? 

o 

<r <r x 

• 

<t 



rv 

Oj tP 

IP > 




0. 







b") 


f- 








I— *> 

r> ? 

-j 


X 

X 

o o f- >»- K - 

H 

H 

?. 

1 JO 

• 

r. 



f- 

<r 

-J 

<t 

•T 











— 





• 

• 

• 


• 

ip x 

>- tv; 

p.) 


X >■ 

X 

>- x >- y 

>- 

X 

> 

tx. fx. ix. 

• • 

• 


• 

u; 

H 

<L 

tU 

ui 

• 

• 

• 

• 

• 






a 

• 

* 

• 

IT 

Cv 

u 

c. 

u < 

c:. 

ir &. 

U) M 

U'v 


s; 

»P r. 

u « b. 

U> 

Ci 

IP 

O. b S. 

U\ u 

b 

c. 

IP fS 

IP 

S 

If 

CS 

tr 

C 

u 

•j, 

U’ 

C- 

If 

e. tP <s 

IP c- 

IT 

u. U 

c> 

at 

t. 

iO P 

p- 

on 

rr 

O' 

«r. o: 

\ — 



cv o. 

X K *r <r ip. 

tr 

VC 

u? p r x 

o c 

O 





o 

0 

X 

X 

V 


u 

u 

VP 

VP P r n 

o o 

C7- 





o 

o. 

cv 

CV CV) cv. 

U r> 

K p, 

IT 


•D 

X 

r. 

P) X p' X 

X 

p 

»■ 

K; P, X 

r, x> 

X 


<1 

<r 



V 

<r 

<2 

<i 

V 

<3 

*3 

<T 


V V V 

1 *T 

V If L" 

L-'' IP 

ip 

o 

01 

o* 

o 

tv 

cv 

cv o. 

0 O 

O: 


O 

cv 

tv 

o’ tv- r. r 

c 

t' 

c 

r o fi 

0 o 

0 

cv 

c. 

c 

O’ 

pi 

o 

cv 

O 

O'. 

o 

o : 

o 

CV 

O' 

OOP 

0. CM C 

rj c 

O 

o 



. W [,' tf P P ' Q IP O' (x «J* 

<T «. ij IT U r- u -3 <T c 


0- c. T. — — 


— tv -e li vr p <i'r<r <r<r<T<r*t«oC'i»' 
U' L' (»' U* UJ l’ - U tx'Cx (.1* U. U. 1/ U It. h U It t«. U. U U U- U. U U U U. 
c<jv<r4<rc4<r<;'sc<ic<r<fl 


!S — C . »■. <T If • V, P- 0- O 

i> r •- r f. r m, t f to wo r k * ■*. sy if 

U ' b ' u u it ip 4i b ir ip tr u' u u if b u tr a 


1/ If U' 'I u b 


lx. lx U. U- U U- tx U U. It 

x r r p r “ • e " <s r 

if u b u if. if 


If b b If li 


v<rr'<rccr<!<T<T^«T<<:<<!C<rcc4r<rc^<JCCcc<j<rP<r^cr^<r^*i' 


*■3 o »o 
>- »-* ve¬ 


er f- <r *- I- **: 


•«j» _ 

o ■ o 


f- x v vr 

'll o 

^ f- f- a 

hxJ uJh 


4 4 0.- — 


t- «f- 

Hi L 

C9 • f 


—• it 

■V <T 


»xj x 

to <t 
3C r 


r 

o UJ 

i— t 


E X n E o Mm 

► • • #• » • < • 

i x ■ j _j ci x u f <* ui x •* o 


m r h o a. 

<t u < x e *. i- rx <r a o<xe ro 

• • • » • * ■? • • » •> * • • » • » • o. 

«<t jj .i j^tu aa *-• _i«xxc_)EQ x<r<.xo_JQxuio 


JHZUJQZU<j|Q.<UQ<:iJ!ilJirtUlIlQ *- 


X X 

*>x>—=»x>>n >rj>>o>«>y>wrn 
• O Z O :> O Z OOC)0-OOOOQO'>OZO.3r* 
:»y:EfHi;j:*nr <t f r <t s: r. r •- s o. o 


J> O Z O > li O 

*■ r « r e w >' 


X > 

z o 
— v 


t. r> : 
rs o < 
to f ^ 


« > x > a 
• o ^ o jL 

: > - ~ r *> 


— r'X>«r>x>>o r'D>>.'nr>-.r.>« 

^>0^.0>0^.00t_)P. OCjOOOO oz 

^ 5 — > * s nvcrrwn i « 


x x 
to 

o o x 

> x a 


U • • • li. **«*o • • • 

u' *» tc c. b"- r ir «u »p *: ui co u< p- u- (si u p it- r. m u> e. it. Pv ip p u. * u mi. e> tMi c- u 5. it mt s tf 1 ' c. it t. ii- f it p umt t bi u if t k Qm 5 if> ^ it mt t> o u. 

p —c\ r it i <r ctPir v m-p ir r t ff f. pt — — O' o or v <r it ir- w. u) r- f tr tr> <r <r P- p.. — — o ci k r <r c in i/ vc vc r- r~ x w o* o p -« wcr o <r<r ii'ir «ni> 

x x tr x x a? x oo to o, to je -x o’ to ou cr i « o c C' c C' J> J p <r crji c. tr j- o, iMMft c> 4 n u \ u &.• r. i: ^ ----- 

- - - - - - - - --— ---- - — — — — pic o- O 0 O CVO O O! O' O' O' O’ C 00 tV'C tv O Ol CM OCV CV O' O CVJO.CVO'C cv 


<T 

c 


P- V 0- 

Pi c X 


Cj 

e. 


•S3 

IS 


to — 

IS O’ 


<x 


ui u: ir f»i u.’ ic K: if «t r < t p 1 p 91 k t* i*j v *«"' u.’ ip tr 
f H' <r w ir. (v ir mt t mi itr~a it o s o «i t ft 


r*.’ >xi p vr l-j if r~ 
CO- 0‘ <4 Cv O' u 


5' If-’ O' U ll' If K, |.' K 
P i/ O L ■ 0. L o 


r» vr p ui u, \c p' uj <r ► <t •»■ o p c r t tj if k *-» »f ir 
0 «r r <r cu. c u r x u p v ir p c u cv c st ^ c: 


tr a a <r cr o u - u. p. — o. 

O' O' O (7 O' O' O' C «T <T <X 
vvv<)'Tv<rc<jt<r 
<r<r<-5r^<i<T<Tctr« 


u «pu. o <t cr p ui i> 
<r<r«<<r<t<X<i<r<i 

<i c <r <r <r ^ <t <r *r <t 


p.- — o c. o Cv * IT vf p 

cn o. cr it a or o.- n a c 

CC^C'JCCC^C 


» < r 0 C'.xiU t ok 

a, x cr a: ci <r ir c O C 

<3 c c c <: c < c t 
■c c <rc <tppp<?p 


^ u a nr I) ^ cr «. Q: O 

o c* c V’t; t f o o o 

^ c c c c c <r ^ c 


oi» c — t. ►. >r p o O' <t cj 

f.rjnrrnc'C'rnnr 

«r < c 


r.) Cj U. p —< K -q c <r 
r r c. u* ix i- u u* ir u: 
•x<^rc<r>j< r c-y<c 
<r <r c < <r «• <r <r <* <? 


Page 26 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 22 


82 










o 

< 


<t : d X 
'£. X N 


f— <t rv. 

•. * «T 

O o O Q : 


M n 

-T 

Q -*J 


<t rv .o' 


rxxxxxxxJSvo vo 

-T — COCVS(S«J®VOin to 

<. ® ® ® *■ — ao cv ^ tv * cv * 


> u •- o => o 

• s_ X Cj O 7 
I U J <t f -j 


. 1 : x.in 

.7 o x <i 

mx jn 


<r o o *- 

u 'p <7 

J a- t .r 


•X C ' 
. y a v. 
JO> 


«] <1 <t 

itror 

<£JO 


<r t <r 
7 cj . 
<r x ir 


f- -«J .0 h di' 


l— t-; _u •:? x co co ui a co co cd cc tn 3 to r» 
"lltown QOnOOQQO Q wow 


<r q. <r a. 
1- o »-* o 


t u> f. t' c. it ^ it* e. tr f u. P- u - <■> u r> u *■" m a c. if- c_ u' <u u u. 

/*. O' C f, c K) KP tr f l£ »i/ h h O’ O O'- C I* • •* ' —• — OI 0; F. 

r c cr- o j. cr o\ o o'* 0 * <r> c cr> <r\ o- rr c* (r & o &. •* | *. cv- * v % 

S', o o: c\’ c o o: o 1 o o cv o< cv (v c c\ oj cv c-.t c o' cv »•) f> f. to f 10 f. 


. c. u. a. 0 5- u' ; •/■■e. u. c: m ® m ® tn &. in <& m e tn c* in ® 

> <r c m u' u) u. 1 h p » rr tr /+• ®6i——•cvcv* toio <r «r m in vo 

' c f e 1, ^ ^ r c r t t — — — — — — — — ——— — — — 

, c/ o h r r r.' r. r. r. ► f *. nion tnnioior tn tow 10 to 


in in c* 

R (M? 
VO VO P 

o>— — 

m tn ® 
ff.p p 
to VO VO 
Cl. — — 


Pi Cm S. in S. 

— to in <T «T 

IS P P CD(^ 

— C\| CU (M (\l 

f . 6 in R R. C. IT IT 

incuot.cv^f-*T®P 
vo— in in m vo p <r 
— ® cc 5. «r e. *s cl 


r. e.voco<tiocccvptocx,«.vou.inocj 
vo vo cr o p cr cncrvopo.^w^copco 
c> is- ■>* <r to to to to to <r to cw m m if. Mv m 
ui fc;-«T<r<i , <T<T5p<T<r^-is«T^r«T<r'*T 


c.' c< r»i ' — — k. vi- p cr u> o c " ■ 

u. vo vo p PP PP P P p r p pni 

o', in u u > u. u iT> u' if mu u u u u » 

<rc<r<T<ic<j«rc<r<T<j<ic<j- 


3: y i) cr a ft 

l u in u if u 

<r <: <r vr <? c 


T 0 rr a. o o 


If ir u< in u 1 /. u L 
C'- ?, <i<rvr>r<iv: *r <1 - 


a 3^ O' 01 tC’b U. U. ■ — cv to <r If• VO P e~ P5 K - P' IS 

a a o' <rr\ O' O' 00 <<r<r<r<r<r<r<ie 

11' u if. u' it it it u u inininmminir. invoppcoa. 

<r^c<r<T<rc<rv <r<T < 7<r<T<r < T<r c <r <r <r <r 


O — to cr 

00 — l») W — <V K- 5f _J <X — CV to <T to 

CO K (/) W P’ P' P (»• tv> X u: > P P’ P P' K : 
J<<r<«<r<r«<tar;j<ic<c«r«r<t 
«r cc o o o o c o o 0 u on o o c o 


X >- 

>- >- _J 
« O O -I 

•-« r o < 

•x o *< crj ^ 

~ n x >- <? 

x u 

P ZOld 

lij alQ> • 

f/> a. <t pj • 


O _J -J.J 

o ■«* <r <t <1 

• r> r> 


o 

P- .X 


l«i X 
f- X 

— o 

=J w-J 
<3 X 
O 


O X 
U UI 


_J J ^ Ul 

<t VI o > 7 


-x v 'ax tx.>- a.>- n a. C. 0 _i <t — o 


— <r><ro<r<ro<r_j—. —. <r p- 1 

r> hocapnciH a _j 2 m u _j: 
5^ cn c j <1 w j < if. tj — <r -> x o ■ 


o ^ 

7 

73 « 
O O O 
: — a => 
U> P- 

-1 — X i 
V V) iJ • u 
•v! O CL a. 
< a. ~ — 

uJ • 

11 • U. 
«J Z. U. 
X J o o 
P- <t 
r> H •• 
7 >- 

a — '■v 

p j j j 
■ o < <r <t 
> 

X P-. NJ 


J* -J 
*X 3 

• fi: — 
O CD 


fv ta 
( *IU.*H 

p- o o 

>• t 


_i r n; 

PJ <4. 

woe 

<t t 

O X 

P- tv 
P o 
1/1 Q3 


a. •— x 
H tn 
'y> jj oc 
o cv 


n _j >- 
<x \ • 

3 P T J 

o» ui <r 

S) 7 7> 
alU«X 
XU. II 
POUIU 
3 V 

fo ui *« n 

P X w 
< p •• 

t.'* h: 
Cm • H 
JPPO 
3 Z 7 
• a. -r 

I- >7 t- 
(OOW 
X o z 
— o 

U. t u 


c 

.•> p- 
>- cr 
II UI 
«r P- 


- JP 
<T — 

II > 3 


o: Vi 7; 

— u. — 
lf» u. 


O Pm 

x _j «r 

J1SU 
X o 


r.) 


«t(T« C 
' X> • 
X X c 


— is. cv ca v- o o 

UIW <T O TW CM V \ M. S i 3 i 

• p. «i • •. p <x •• cr it a* • • o 

p.a <1 r 

o 7 
^ — UI 


1 XOO 'J Ci < 1 


< m r > *- r. m > m — n 

■x f joxzr.<O^N-x«x 
UK i-«t J r <tn jno k 


w. .— — u o 3> x > 

• o— K-Czacar. OZO'. 


ii' j r -t r x s <r >• o *r x a* o* *3 — c 


U C. Z 
i ft! 7 


Q • • 


r» « ^ii-.tii' f .u c. if. <s. u r. uv c. I', r- u> & u' e» if\ c» if ^ 10 51 in & in u ir c» if. 6 . in c. uve in is me u> e. u 

to to ^ «r tiv m vo vo p p ir t n in e» cj —— c c-. r o *r <r u iovcmcpp axtMTiNN--cvciir, tn^«rinif vovoppornr 

»fv in m it it inif in if mifinm. irvovo'ovovovovovovovovow'Ovovo'0'ovovovoppppppp'P'e'PPPPPP f ^'P r " 

cv, c\' cv n p' cv o* c • tv c. o cv cv cv cv cv 01 cv 01 cv a: cv o 01 cv 01 cv cv cv cv cv o o> ci c o. o: v o 0 o- cv 0 c> c»- o cv oj cv o: cv o 


_ m e. in u. m ex m e* m c. if 

vo vo p p- - -- 


(k If. Cv If. t. IT & If L If c . II - u CU U U V- a C-. U 

orrr’O'O'^ea — — cm cv to to <r ^ ir tr *0 vo r- p cr c 

p p p p 0.' tr xi x j.‘ a- u, vo a no a o', a w*' "• x m i 

CV O Oi O’ O' CV O’ O. O' CV O' C o* CV Oj CV O' o. c O. O' c 


<r v <r «y in 
■q <r q q q 


IT ?,• 

Ui 


<T C C' IT <T If CV IS 

<r f, <r f q e f 


ir 

<r 


— u. o c; c. o to 

f' U U U U u. t>. 


1 • o p <t rr c\ <r * o o 
e t> 9 t, itit 10 y r, u 


ere? <r u to f 
c. bJixciO 


<r — — t rr vo cv — <rvo<r — cr 
c: e — ui p -jJ o tv p uiu r l 


— <T VO U. U. t*. e CP U VO P P P CV'T — u o ^VC-P 

f p uj e. e <r < p u: — — — n e- f o q- !■ p '--J *s. 


u — «r m cc c> o u. ti w » if 0 <x c. 

CV O. Cl O Oi 

u ir tn if u i»‘ u u v . if ■ u • u ■ if' u 

<r <r<T<Tqvr<r<T<jq < rirc^c 


u’ e to f- K’ tj f o k. r to m n k 

O to to K- to to to to K.' F. F F< *r> F' 

if m u u u in *n u x» u in in if. in 


kj f n t; Ki r F/ vo o uQuif f vo 

to to F F F. F. F) F F F F. F «T «T 

if uv if• u. in in ir< if' in ir if> if> u u~ in 

<r<rc<r<rqq<r<r^<r'Cqq<r 


p t o u s e e. 5 r. s v f i>- o 
q <ut <mr ifinvnirininirin 

U li lf U t u.ll If ll'lf li’ll H U 


« n o i«i u. & - <pr> v p x a 6^ a 

u if m m m vo u ? u vote v- vo vj 10 v 

ir, u if u. u> m in u tn iT'm in u mu 

c q <r <r ^ ^ 


Number 22 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 27 

83 




U. <T trl UJ 9 sp U1 tv V£? — 
<sT«7srr^^CMPCsTCV 

B00CMB.inCM«Tf~CMO 

UJ O VD '.•! £M vf •— <7 UJ II 

cv,o<rcjoo<Tcv<rr~ tr» 

p- sr co cr> cd to to ^ cv 

f- <r b u f- cm o U' <sj c\j 

to so uj — <r cj u <r ui «' 

c\jOs(Mr-<Tc^ir.ucvu' 

B IO IO O CM IQ IO in CM 

o sj cv -t b o <r n ^ 

CMMC 5. < UJ U? «t W -*3 
PI <3 U M' IT MJ w 

c\i on to in to u oi io u. u. 
<tuu«rcnrif ip«i <r 

u <t <r b <i ir ui to to Cm 
tvusrt.r~oCMO!CM <r 

M vc vr — uj U) u. vc vc 
r-cD^(Vtr<r«-ir<T a 

k> u. <r m to to cm so bj **. 
CV<TU.sTCVOjs 7BB t- 

r- to b a - so so so w c«i ¥ - 

sr e; bj b in ^ tr> o- cv O' 

cm <r so cj so c on ui u. »" 

<r «r u o b B r- < tn m 

U vC tf it u> U) ¥ r ►-> U, 

ts h«r<rp P 1 c P ' i7> o 


tv r u; ■%» t> u «* O' <c cr 

tr n ij r j <r r- o B c* 

p. srev'Vwou.J'U.insj -i 

<S <i t> tuj & \ <r >r <? cm 

f; o r" — «r u. u. — a u . t* 

.?• X' a' u. v« 

b «t it*. <r <r o — w> flv cm rj 

•? to <z <r c . to m -r r. to oc 

\ M< 'j t ^ <r u. k - \ 

f ^Q«r-«u -><fuvji 
tv <T O n CT- <T 5 <T *0 <T 

r k <r t. if c>. in u. u p, 

B U -7 ^J<7C If) U. U t. 

(V cv C. R CD S CM t^ <t CM X, 

r. r tv 

ts — O »<r -P B CT. (TJ — 

r. b r> o cv — fjj — uj B 

— '*• b u» tv o~ t- — in u, <7 

1 ^ |f> t f <r tv — to «r <x B 

— t? -r nif o p ^ n k t. 

*S- -3 ♦QWr-lil'SC’X 

b o u c» e u> -ij < <t a 

<v e u<rPi k ppr u 

r. r «■ ir 'T- «-p a' <r V 

T B K* 5? *r! C U’ ^ f»J y V 

&9Vb Sli^kP “T CV. U 
B R- sr * e. sr o C'K-I, 


B 


> — Q 
l» <A ui 
/ — Q 


&> 


t— D- 

ui h e> 

o 

T 

CC ID O 

E 

UI 

— <0C 

a. 

rr 

b-JQ. 


M, • 

^ CD C\i 

in — ^ b. 

— p • <s 

■v ~ - -ts 

— ~ Z ^ 

• ^ _J 

O u j H ffl 


is e- 
e» c. cw 
ts (V 

it cr cl> <£ 

in 

h a cl Oo u; 

=J ZD • ♦ 

tt. W 1/1 Cl D 


DC<IOr D OOO" 
w <U O COOU-OUQO. 

ti II it 2 C H 

hOXO^(3MS5.ce,S 
CD « — CVJ K. <T 

*->m CvLTCV(VtSOtSCS.CVtS 
OJ CM <T in VC <T <r <7 <7 <T 


tr <r 
<r u 

II II 

X o 


in vd 

B B 
*T <T 


t- a. t- 

X o II 

UJ f— —* 
Z W p 

Pi IS IS 
MT R 
BBS, 

«r <r cp 


If, ? -7 

o —« vn 
U W w 

• • l- 

(t O' z 

II II •— 

•V tv II 

X >- o 

c B tr. 

— cv to 

IS c. tv 
CC CD OJ 


~ z t~ 
t- a. • 
z = — 
*-• z 

II UJ li 

W or. cr 

fs C 6 - 
<r m c 

B B B 
on 00 £71 


H O X. 
UJ 2 UJ 
DC UJ 0- 

BBC 
— CV to 
B B B 


U’ <r cr t u u n- <r> 

MiPGviPin^p 


B c u <r o u c K m rr.c 
B c: U C.' n. <7 r~ B <T U. t*J 


U U7 

x cr 


<r Kj D If) Hi P P c B 

PiP'cetreDPKP to <r 


<X S U) U u. 

u <r UP- cr <r 


<rc'&-<r\<7'C'O.0'(r ? c <r> cr C7< c* cr>c o- a tr 
iriohtt^<rciU'Ci'U.P - p k <7 in w p n cr 
<7 v <mi <r <r «r c <r <i <r u ir d u u> ii' ru u it 


s> 

w 

ts> 

CVJ 

B 

<r 

B 

CV 

in 

cr> 

cn 


m 

CVJ 

CVJ 

B 

<T 

Cm 

CVJ 

B B 

to cn 

CVJ cc 

tU — 


m ts b in 

in t*- b b 

<71 — OC 

— CVJ CVJ — 

IT in B B 

to £7) in UJ 

£7* C7N m D- 

— — CJ — 

B m B B 

9 . to <r m 

co £7i in r- 

— — CVJ —< 


Q io cjp- lOoBm — <rp <7Du.«7P'U.wrr<ir 

OQU7«kPiWIMrs 77P7 ^ — P-t-CM — 

PVD<7Q<I'-<I’IUJP'UStO<IDW»ODlfUn 
^P-irUPiP’PKkKkSOk^UP 1 7k7 

BUIiO(U«TR>ITBin -T U CM C\, io CVJ O’ IT — <TI0«T 
KD<7k<f UI <7 S <r O e CVJCMlkJCMB£rir> BXB 

--u-wQtiioMninicMnuuJcr. <tnowai- 

(CStOKlli.kMTS'fi-JWUlDlOOlOf'P tOCMCM 


B 

in 

CVi I 

B B 

CD £7. 

*7 so 

— B 


in 6*. 


r~ r- 

<7 ST 


U\ B 
B r> 
O '- CM 

— CVI 

B B 

kj er. 

r~ — 

— cv 


B t-» 

to £71 

f- — 

— cv 

in cr 

so W 

— B 

— CM 


u in 

CM — 

^ to 

B ~- 

B B 
O' <7 
<7 — 


lOIOCM*- CMtOCM — WOtJP k C 5 IP 'O r„ umt 
7001.0 00^0^1104)7 0, 0<TPKiP7 


ir. ir 

vc r 

in b 

OJ to 


m in b 

in. in a 

in P. r- 

C „ r ‘ e. 


CMSTQUJB UJ C. £7 P- CM UJ «t < CM B U. U UMl k‘< 4 J 

u. <t — to no B OJ B — O U. m CM CM B li^ B CV B B 

K) UJ 7 ; <r S 7 IOi£)Ms(E<CEP-Q-U’-G<Jli J C 

ui-j w u sr o id n — uj 10 r- v o Cw <r " b cm o 

IP a\ P-IP Q U. ifl 10 P OS Os <T\ BIOS—- £7\-«ino — 
VUP <7 U<rt-B-oop'ippr. ojkjiou 

o tou.o<tx£c — p-ctcmo — oBcr — cvu m 

ts. <7 < B to ST UJ B — <7 -- — Kj r & r O o Q (v, <r 


B P SIP 

to or to uj 

Os IO B CM 

ts> ;B —• ts: 


b b m in m b 

m — to or, 01 00 

CM CM VC VO CV £»> 

CV-— B B 


B 

in 

to 

B 


r m b if 
O'. CM B CD 

— e. e. t 

I 1 • 


5) ip in ir 

t- B CM — 
to <7 p 1 r. 
— — — CM 

I ! • l 


m ir> b tv 
to sc B oc 

— to <7 VC 


if b e ir x m 

— £7- — if £D CM 

cm m —• on b pc 
B C. B -- <v. — 


in 

tr. 


B IT, in B 
|o If • to r- 

CM O' VC — 
— Oi — o. 

B B in B If 
r, D- CM CM CM 
— CV£7v< , ~ 

— tr cv — cv 
I'll 


B m B B B 
r in —to os 
B £7V m to «7I 

— — — B B 


If' u 1/ 

«r so C. 

to cr p 

B 1 CM B 


m in m b m ir p . in e b b 

<7 OjODP P P~ CM f; in K — 

B or to to B — or to — inio 

B — — BB — — B — OB 


oj kj cr cm sTF.tsinu.BB oirno^s-in<7K, 
CV V B C’ <7 ^ C ST - K IE « O o U If F. D «7 <7 1C 

OD Q B CD O <tBU. UJ— BU-UimiOlf' — £7\<TCMO 

UlU? ST U OB «TUJ — t«-B IS. <7-7 <1 C. OB^TO 

c;. to — bcmb — <ru. — vrujiocvcMBin. «v o* o <7 

U ST — B to ST — o CM B Uj fxJ C B U P' C> U Of ST 

rcMOc — Bu>BBrou><r<ru-Cvn<rusT«.ifO 
«ro ^ cvi cc. id c f. Mu - - < pj to <r src^^ u. 


Vj o UI 10 O' d f ip OJ 
to o C sr U B O' to <7 
intO<T»OK. K sr «7 <7 
<r <r <r <r sr <r <7 <7 <7 


U—BtSB<a.sj- 

— oj Q B b b b rr 
sr * to ou m u> sj 

srsr S7<7 ST VI ST <7 


O — U. C C . <7 10 £M 
tSP BBCT, UiO-crsr 
in to iiipv si if m sr 

S7S7<TS7<7S7<TS7S7 


0<TUJBir «r CUB 
tO Cs BB — U-BO«B 
to k) to uj k, sr in if u' 

<7 S7 ST ST <T *T <7 *T *T 


If'CUCC 

O O B B 

to ro u u 

S7 S7 ST S7 


uj sr t^ ts 
e B U B 
U' if sr ir\ 
<T ST ST SJ- 


cr to u 

B B B B 

u. in if in 

<7 <7 s; s- 


e — u. u* 

U R U U 

sr if si 

ST ST ST ST 


(V D B. 9 ST B Cw vf. U. <T D- lf\ B If CD U . <X <T a’ Pi 

IS U F (J 7 FF UI 7 P <7 7 <7 n <7 <T <f k P fi P’ 

cm to — r ocr—truer, unto — toBK-sTKom 

P 7P,7tCI5,PMS.'E6K klfFt. C». PK <7 

Hi Uk - 7 IT7 7 ui U. If P t) 7 c - 7 7 r - u 

UJ to B tO K" 77F-7UIISOPIUK IO 7 P’ O B 


u. f- n — N K — V V> — O — <VI CL O B. — O f— UJ O 

j ch r •-> < 0 13 . a. a. a. ? < o. cs c a >- uinnporih 7 x x < cr tt t-_jf- 

R'U 7 -< 2 lD 000 CCCt- 0 <r<r-X Z f M If' Z Z O >- H h h « O ffH E 

CflU. 1 -HMO.a. C.C-£Laif)hJJJO^«l-77l' il -slJnU)UJUit-p-h7< 

oddc nncococ c c. o u u U u j jraanao. cr. tncntnu. 


U' O tr U O n UJ C — — — ..—.. ” ” .... 

C. WDUiO'OJirSUiDrOJtt'O-1 O' O' O' O O' O 9 O O' 9> 9 9 9 0. O' O' O O 990 

C.0.02X3<rU'02I3«rUJC <L R - P. r 7 If VC P B.' f 7 III U f U’ I., K - P f, 7 

/ 7 U- O I— I— J> P k Oh I* J 5> I io D t- io f' k. t> r t, io to n io r. io r; <i ^ ^ ^ ^ 

SSVVXVVfV^i-V-R V-VX-K 


Page 28 

84 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 22 






U! 

2 


<T 

©ft 

DC 

o 

o 


to 

cr 


u. 


>- 
s r- 

Q 
— UJ 

ft- o 
<r 
o 

CC _J 
Q 

o ac 
<r <t 
CC 
H*U 
CO O 

<x cc 

_JCX 


. — — w 


c * 

D. CC 

UHH I 

>- war : 

U! O, O- C 


G Z 2 2 2 


cr 


S S ( 
is S I 
V£ s t 


2 • * 
— C t I 
J » 1 

h K K • 
=5 K >- > 

• a. r t i 


o x 

• IS UJ 

■ O z 

lft t ■ 


ft -J — — i 


>■ roc 

C h- UJ O ( 
<i to cr 
UJ — (St 
cr j in — - 


2 Z 2 z : 
7~ I 

u i k cc a a; i 
a. a. a a a. i 

s s K k k i 


j «r ir in —-— • 


=3 C 
. in h 
j o o 

: ID id 


• u 

* UJ — 

; cr. — to 

u s u> 

tO >- Pi 

j ♦ t- 

: cr is — 

■ s <r X 

s uj ^ _i 

— j o _J 

o cr <r 

: o <i o 

her n H 

. o 2 UJ Cl O 

'Ofcicr 

IS. IS 
S K a -is• — 
- o «si cr. s is' 

■ — cv cr — — 


uj 4 ~ 
7 UJ- 
— lft VC? 

-J cv — 
• r-~ 

Dt S — 
<t X w 

2 O' ~ -J 
O' Q ID J 
zd cr <r 
H V <1 O 
U1 U’ il ii 

cr cr c© o 

g 5i s 

c cr IT. — 

is cr is 

— <7 IT lft 


w 

2 

Q ft- 
2 CV 
CD — 
O II 

cr — 
cc >- 
=j — 
to is 


~ <r is in ir> 

J 2 cr v ft ft- f~ 

| _j cr g — CCl C\i Cv, co cv 

*T=> SO - — =J — IS 

. o h r ii w ii n to ii •• 

II Ii! W S O 5 *-0 5 ft- 

c* it ir x c >c. >c ir >• x 


a. 

to <r <r 


re <r 
c if <r 
II c\j 

G- 

2 X 
<T - O 
•V I— 

a. ui <r g 

r> n s - g s 

«S l IS IS 

f— >- ii Ki ui cr 

2 U! •• I 

— trio-stv'scacn 
: — s :=> — vc? x ro r? 

) " "" to h- V II ex Ii to to 

. — — r o K UJ 5 o r, o o 

' X >- X to IV i X U. X o o 


«S is. 


is ir- 
> 


S S 
CV IS s 

l is IS 
m in cr. 

i 

<s ao cr. 

>-=>=) 

ii to to 
<s o o 

>- ID ID 


IS IS 

K IS IS ' 
4 is IS 
MT. CM 


II lO to 
KOO 
X ID o 


Cm CXI 

>- m 
n to 
•s o 
>- ID 


to X ex X 
CWOU' 
U 2 U 2 


cr « 
h- >- 
to II 
fr- — 

IS o X 
— 0—2 
cu ts, rr 

o x ZD 
f— T H V- 

O UJ — UJ 

id cr x cr 


& ts cr- ts cr s in s <r. u> r» r. ^ s <* c o 
cj K' <r c rs — n cv k- <r <r in vr r o r* o 
SSSCTSSSSSC SSSC CvG—c;. 

tr in L'' in vC' vfi. vr vo vn vc* vc? vn vn vc: vn vc. 


s s s s s s s r, e; ® g s e r. t s g k is e> 

r — p ^ s ir io h cr <r rs — o r<rmv^r-<rs — 

>. S s S S S S S S S S is S S s S S S CT| s s 

r'-r'~r-r-r~r—f'-f'-r'-r-cc'cococx.O'.DjiX'Ocx.cTicri 


OSj 

O 


o — 



Cv, 


l- »-* 


fN 



5- 


Qu 


r- 

u — Ci 
V (T X 


CP" J 
G Q 
<7 0 7 
< C 
h- Cr 


>- 

G 

<r 

W 

ft 


UJ C 

a. g — — 

CD ZD • Z' 

oh a c 

-J — r- • T r 

^ U t" * r C < - 

w x <r c <r ir x f . 

ft. h- > <7 4 — CT' 


— • C\ *7 !• * — 

r'G^ — c s <r s - — — — c 

— — C x < 1 ' 4 «IC< • t C.CUJ. o •— 

S'-o —"svvio • • • c. 'j n 

^ J J I- H- <T *— CV f • h h - C t/ f \ c 
O-J ; 3^ ? OR'tt 7 1''" 

ft. <r >: •- a ii n •• h h a n « •• <r a r 

<r o uj cr z <7 — c\ ► — cr z< — co f »• ii u 1 

ii ii o t h « < < <i o. a h t x r " C5 ct 

X 


h S p S Cv s 15 s c. s s s s s s s t 

itpgc -prsif'njhcr^K-KK-cG 

»-. s; — 6. s s s tv p ssse — — —— s 


i*’ t ; ~ 

o *-* 

r«- o i r 

U’ • * 

f- !»', 

to <r <r 


o g 'r 

h- • • ^ — 

f- »- «7 U 

t W W VC V»' c 

to 2 • • S 


CT 

S 

K 


ii o m x >- p vr> O'-' 

U t** IT b- ^ ^ *- L f ^ _J 2 

h- • • • • t— H eti (V U J J ^ 

— — 4 4 z 2 r* l- ft • 4 e. < r> 

u <x <. x x •— •— tv x o ci o <i o h • 

c ii ii •• •• ii ii o u* i— ii ii ii ii tu 

U >- > x >• g u cr 2 to g g x 2 ) a. 


s r. s s s c e s r r ts s s s s 
^ c x<7ir vnr-crrrs—c\K<r 
SC- SSP. SPSS — sssss 

r ft ft’ ft cv ft ftj ft. cv ft ft ft- r- ft- r- 


co 

U’ 


to 

<r 

7. 

K) 


to 

o 

2 

o 

s cc s 

4 . <r * 

s x e. 

— k> — 

ft- ft-: 


Number 22 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 29 


) • 

J 


85 




DAZZLER DRIVER 
Subroutines and a'Chase' 


BY PHILLIP SIMPSON 

1043 Shandwick Ct. 

San Jose, CA 95136 

Dear Jim and Tom: Received: 78 Jan 6 

After reading Joe Sanger’s article Video Chase for the 
8080/VDM (DDJ, May 1977), I began to wonder why all the 
software for video display devices is being written for VDM’s 
while I sit with my $200+ DAZZLER watching random color 
patterns. What happened to all those people who bought 
DAZZLER’s? Why aren’t they writing software for the rest 
of us? 

The solution was, of course, obvious... the reason I spent 
all that money on this funny looking box with the blinking 
lights was for the fun!? of programming. So I undertook to 
convert CHASE for the DAZZLER. This accomplished, I 
broke out the subroutines used to drive the DAZZLER, added 
a few more bells and whistles and created a DAZZLER 
DRIVER. What follows is a description of the driver and my 
adaptation of CHASE! I’ve also included some examples to 
show how it can be used for display of moving objects and 
alphanumerics. It can even be used by a BASIC program. 

One other note for those people who, like me, have a com¬ 
puter without a front panel. If your DAZZLER mysteriously 
turns off from time to time, check to see if you have imple¬ 
mented the power on clear line. In my case, the line was 
floating and random noise would turn off my display about 
every ten seconds. This can be fixed by putting a pullup 
resistor on pin 13 if IC 58. A simple solution but it took me 
almost twenty hours of trouble shooting to figure it out! 

Keep up the good work! 

Phillip Simpson 1043 Shandwick Ct. 

San Jose, CA 95136 

DAZZLER DRIVER 

The DAZZLER DRIVER subroutines form the basis for 
a comprehensive display driver for the DAZZLER video 
boards. The DAZZLER itself has been described in other pub¬ 
lications {Byte, June ’76, Popular Electronics, Feb. ’76) 
so I won’t go into any detail here. Below is a description of 
each subroutine, not necessarily in order: 

TRANS-Urn 1200 

This is the core of the driver package. It translates the X 
and Y coordinates into a memory address. It assumes the 
picture is in the 64 by 64 resolution mode. If the X and Y 
location is in the left half of the byte, the carry bit is set. 
This is a modification of a program that originally appeared 
in the December 1976 issue of Byte. In my version, X=0, 
Y=0 is in the lower left corner of the screen. 

ERASE’—Line 7620 

This routine will erase 256 bytes times the number in 
the A register starting at the memory location in H and L. 
CLEAR- Line 7700 

This clears 2K of memory starting at the location contained 
at ‘MEM’ (line 0222). All routines make reference to ‘MEM’ 
for the starting location of the picture. To move the picture 


to a different area of memory, just change the value stored 
at ‘MEM’. Remember, it’s least significant byte first then 
most significant byte. 

PLOTB-Une 8040 

This routine will plot one element on a 128 by 128 grid. 
X and Y are in B and C respectively. If the carry bit is set, 
a white element is plotted. If the carry is reset, a black element 
is plotted. My original version of this used bit rotation to get 
to the right bit within the eight bit byte. However, after seeing 
Lichen Wang’s solution to this problem ( DDJ , Vol. 2, No. 8), 
I adopted his method. 

PLOTG- Line 8300 

This is used in the 128 by 128 mode. It will plot a figure of 
size D by E on the screen with the lower left corner at the X 
and Y location in B and C respectively. The location of the 
figure to be plotted must be in H and L. The following 
example plots a flying saucer on the screen, then moves it 
from left to right. When it disappears off the right side it 
reappears on the left. Note that the figure of the flying saucer 
has black elements on the left edge (The routine plots X, Y; X, 
Y+l; X, Y+2. ...X, Y+n; X+l, Y; X+l, Y+l.... X+l, Y+n; 
etc.). This way it erases itself as it moves across the screen to 
the right. 


7039 


9618 

* FLYING SAUCER 

7030 


8815 

* 

7038 

C01978 

0100 

CALL CLEAR 

7033 

->E7F 

0105 

HVI a7FK 

7035 

B38F 

0110 

OUT 6FH 

7037 

816060 

1080 

LXI B/ 6868H 

703A 

11088E 

1685 

LX I Dr 6EG8H 

7C8D 

211D7C- 

1010 

LXI Hr LQC 

7C18 

E5 

1011 

LOUP PUSH H 

TCii 

05 

1012 

PUSH D 

7C12 

C5 

1013 

PUSH B 

7C13 

CD1F78 

1015 

CALL PLOTG 

7C16 

Cl 

1616 

POP B 

7C17 

Oi 

1617 

POP B 

7C1S 

El 

1818 

POP H 

7C19 

64 

1626 

I HR B 

TClfi 

C3187C 

1621 

JMP LOOP 

7C1D 

86 

1823 

LGC DB 83H 

7C1E 

0008 

1824 

DU 6836H 

7C20 

fffiin 

1825 

DU 1C88H 

7C22 

I43C 

1026 

DU 3C14H 

7C24 

3WC 

1827 

DU 3C36H 

7C26 

141C 

1028 

DU !Ci4H 

7028 

6808 

1629 

DU 0S08H 

TCZfl 

0600 

1030 

DU 8000H 

7819 


9808 

CLEAR EQU 7819H 

731F 


9810 PLOTG EQU 781FH 


Page 30 Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 Number 22 


86 




Figure 1 shows how the individual bits are plotted. 


BIT 0 
BIT 1 
BIT 2 
BIT 3 
BIT 4 
EIT 5 
BIT 6 
BIT 7 

00 00 06 08 1C 14 3C 36 3C 14 IC 06 08 00 00 
























X 












X 

X 

X 

X 

X 

X 

X 







X 

X 

X 


X 


X 


X 

X 

X 







X 

X 

X 

X 

X 

X 

X 











X 

X 

X 






































the game ‘board’ is 32 by 32. Each square is made up of four 
nybbles. For example, to put an ‘X’ at location 5, 5 load 5 
into both the B and C registers, 96 hex into D, 69 hex into E, 
then call PLOT. 

GET—Line 7210 

Get returns the value of the two bytes at the ‘board’ 
location in B and C. It is used by the COMP routine to see if 
the location contains a man, robot, or fence. 

COMP-Line 7505 

This tests for the presence of a figure at the X and Y ‘board’ 
location in B and C. The zero is set if the figure in D and E 
matches that at location B and C. 

Access From A BASIC Program 


HEX DATA 

Data is plotted most significant bit first. Grid can be any X and Y 
dimension but 8 bits high makes it easy. 

FIGURE 1 


PLTBY—lAne 8835 

This plots the nybble in register D (the four least significant 
bits) and the X and Y location in B and C. X and Y should be 
between 0 and 63. As with all of the routines, if the values 
exceed the limits the more significant bits are discarded. For 
example, 96 would be truncated to 32. 

PLOTW—Line 8545 

This is similar to PLOTG except that it plots one nybble at 
a time. Although it was designed to be used in the 64 by 64 
mode, it can be used in the 128 by 128 resolution mode. X 
and Y must still be less than 64 but the display will be a series 
of dots depending upon whether or not a bit is set. The 
following example plots the letter ‘A’ on the screen using 
PLOTW and the 128 by 128 mode. 


7C00 


0018 

+ PRINT AN "A" 

7C00 


8815 

* 

7C88 

CD1978 

8100 

CALL CLEAR 

7033 

-3E7F 

8105 

MV I A/7FH 

7035 

D38F 

0110 

OUT 0FH 

7037 

011D1D 

1800 

LX I B/1D1DH 

703A 

118403 

1885 

LXI D/0364H 

703D 

21167C 

1810 

LX I H/LOC 

7C10 

CD2578 

1815 

CALL PLOTW 

7C13 

C38966 

1821 

JMP 8 

7C16 

1758 

1824 

LOC DU 5317H 

7C18 

0389 

1025 

DU 0903H 

7C1A 

1558 

1826 

DU 5015H 

7819 


9880 

CLEAR EQU 7819H 

7o25 


9818 

PLOTW EQU 7325H 


Gf 77V—Line 6035 

In many games, it is necessary to see what is in a location 
on the board to see what action to take next. GETN returns 
the value of the nybble at location X and Y specified by B and 
C. The value is returned in the four least significant bits of the 
A register. 

PLOT -Line 7003 

This is the first of three routines devised for the game of 
CHASE! Although the DAZZLER is in the 128 by 128 mode, 


In order to access the routines from a BASIC program, first 
POKE the values needed for the various registers in the 
locations provided (lines 0200 to 0215). Then CALL the 
appropriate routine. 

BGETN -Line 2125 

This will get the nybble addressed by the X and Y bytes 
POKED into location BC and put it in location ACM. 
BPLTN-U ne 2310 

The nybbles stored in the least significant bits at DE are 
plotted at the X and Y location stored at BC. 

BPLTB—Line 2310 

The low order bit of the byte stored at ACM is plotted 
onto the screen at the X and Y location stored at BC. This is 
intended for use in the 128 by 128 mode. 

Here is an example of a program that takes the X and Y 
values and the color (Z) and plots it using the DAZZLER. 

LIST 

19 REM BfiSIC PROGRAM TO PLOT COLORS 

20 REM IN 64 BY 64 MODE. Z IS COLOR. 

30 REM Z IS IN THE RANGE 8 TO 15. 

46 REN 

108 COLL 38745 
105 OUT 15, 48 
288 INPUT "X=";X 
205 INPUT "V=";Y 
218 INPUT "Z= H ; Z 
309 POKE 38721/ X 
305 POKE 38728/V 
318 POKE 38722/ Z 
315 CALL 38766 
400 GOTO 288 

READY 


CHASE! 

The rules are the same as in Sanger’s version. However, 
scoring and comments are output to a teletype or TV Type¬ 
writer rather than displayed on the screen. Also, there is no 
compass rose displayed so you must remember the moves: 

T YU 
GH J 
BNM 

where H means no move. 

User supplied routines are: 

MONITOR 

Puts the address of your monitor at 7CCEH. This is where it 


Number 22 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 31 


87 




iXIO 

> ^ *» "l 

! '3D OD 03 


• O O O -J * 

’dd a! 2d 


i «3D IT> CO 
> UD MD r- 

»r -.i i-.'i fs-> 


LO 'oD .3? LO • 

r- r- rx> co * 

r -> ixi r<i rx* i 


i5co_j: 

: C£o>: 

: uj co cd , 

• 32 ccsr : 
o 


» CO LOCO I 

i CSC* CO xH ■ 
i 


ggg 


I- 1.0 C3i l 

XUJLOi 
[y zs. Co 

21—«UV 
t— UJ * 
UJ 2D O «, 
IDO' 

i— c*c cc i 


• *S> CO lO 
I CM CO ‘3D 

■ '** '3D co 

• xH CM ifvj 


CO LO 'S* ______ _ ______ r ___ 

•h ■h c\i c>j iX« fa fa fa ud '-jd r- c5 co co xH t-h cm cm r<i fa ^ fa fa gd 

CO £D CO CD CO CD CD '31' CD 'S' S' CO CO CD CD xH xH xH xH xH x-| -xH xH < x-l xH xH xH CM 

c\j <Sj <Sj >:\i c\i c>j cm cm cm cm cm cm cm cm cm cm cm cm cm cm cm cm cm cm cm cm cm cm cm 


SI is * 

h— O ill I— h- 
j CftfiM \j\ 

li£!£R32 j£l 

< UJ UJ 

IUJGQ, >0 23 
JZUJEUJ^ 

) x ^ X X ZSL 
>— UJ !— H- f— 
J 33u— UJ UJ 

ZOZIhLL CD 
- Ce.‘ UJ K— CC CD ClD 

*■ *• fr # •* ■* *• 

i IO CO LO CO LO CO ‘3D 
) IO UD UD r - r- ClD ‘3D 


_ co o it 

X O Q d UJ 

_i££owE 


•3> ID '3 LO X LO X IT) X' 'S' l 

•r\j od r- 'i r -i *#■ u*i id '.£' CC' < 


co 

r- 

. <f X' 

j r-- cti r- r-- r-. r-- d r_i hb 
IrTNQS'QHQ-HUJ 


8$teC3i£3 


'3 ij,. 'O 


. UI 

! I U_ UJ 
• o Ct 


c3,jcc: 

•-0 x o *: 

' 'X x o£ 

1 1 — _ 1 x 

CCiXtiJ 2 - XXCCXCj COXCC^-XcXil 

1 £ 2? ~i £ Fb p 'i ^ S uj uj c£ co § i*\j 5' 

! >"• H~ * C2! 3 

uj u_ o co or *—• >- :> *—1 ct: cti z^- *—* z>- 11—1 : 

33 —* »~h z e: 2 o q -c n a: z q co Ci sr n < 

11 — 23 o_ <:c u a: s: 23 rc ^ ^ e i.n k: .x: *x •->: 

Cxi ,cr i 

J»L J|i. f Q.; 


‘3>3>*~»Z> 
) O O CO o 

: a: ■&. ui b: 


1 £ CO 

• COO ^• 
l OCl£ O 
: tea x 


LO CO S' 
'Ti • Ti ‘3D 

cr» a-. C2* 

CO CO xH 


U .»'S* U"!* «Si -3D U"i r>- 'S' IO 'S' b~ .S' U“> 'S> U" 'S' IO »3D U“« ( 

c\t 1 X 1 ix* rf .S' -3D co th r<* ^ cf to u*> 'ai* ••i!' r«- r- co od •: 

•-uj 'S' 'S' S' CM CM CM CM CM CM CM CM CM CM CM CM CM CM CM < 


x-l xH x-l -cH «H rH xH xH tH xH xH xH 


• CO LO CO LO 
» CO CO x—I xH 

1 fa (■<1 r-*> ro 


•S' ‘S' 10 

cm ro r-D 

rv> 1 x 1 

xHx-l H 


gj-o X 

03 CU 

•C w ON 
1-. rn 
CT3 - X 

OX ^ 


ui- U 'ji.' :^i 1 \l IJ*I 


5 ™ 

D-INpH 

, S r 

» hk 

) u 


V N _ 

m o 

C/3 

5^13 

fad's 

oa w 

r~- 


'§0 

uj r-~ 


| § 



# * * -v # 

* 


I * X 

CO * UJ 

x i.n * ce; o 

a= * r- ce; 1 j] 

arr i t: ass 

_ 13 ^ xlD 

NO * C.J CO X 

r-j ce. *■ 's. o oc o 

X * CM I— OQL 

id * -rH UT U. U_ 

* 


X 

§ 

OOQQ © 

2233 Z 


Ci UJ ft ujO> 3 : ZZijj 

X I— Cl. Cl XI— I— XI— X 1— 1— h- 

§ t-£uS§Sdo!§a!£yS^& 

o 

r-- CLa.LL.LLiiixci.CLa.ij.Q,Q.a.LL 

eesessseeeSees 

"~vr o O O O O O ►*) *"^1 o 


S3 S3 
ouju uj 
iSoiif* S3 * 


CO CO CO 'Xj 'X' CO 'J’i Ci X Cl CO CO CO X 

r- r- r-r- r- r- r- r- r- r- r- r- r- r-_ 

O '3 S' X' X> rt r-H !'•■) tH CSS UJ UJ IN. CO T-- U. X T -- C 

llll I 3 §nS&§ 8 §S§ 8 B 8 


X* X 1 X> X> dx> X x 


Page 32 


Dr. Dobb’s Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 22 


88 






LTl 


O'l 


X X o 

az<£ coc£ 


xx: as: x _ cS e 

.. *. oo i” *1 co r~ ^ 

O UJ Q30UXUJ x X CO 
_ x x x x 

X_>X-J>-Di-x:>I»-C0XCL.>-Q£:0-:> CO X X Is- Cl. t— 

-~-■—■ ~d x o o :z o o x> x o cd o x 

— — * cx e: o. o i5L e ci- c«c 


Q£ O X O CD X O CD X CL. c_> r_j . 

KJCttEECtEECcOlXE' 


vll 
x + h- 
cri i— ;i- >~i 

UJ2WZ ,2h- 
X >—I 13 H x >-1 7r- 
'X Lfl CO LjJ 

a. co uj co :c x 

SuJ uj x o t— x 

oi i— i— >- io etc cd 
CD Z- Ci- !— X X X 
X X X X X r-j ►-< X 
X X 

EC X C3 X O X I— X 

oiujiot-ixti; 

Oh-Cth J«H 1.0 x 


X rH X 

h* Cl. 

X l-U X X CD X 

iflOO % CD o 

p aatfooi x cl. 

CO. 


is- x ru is- x. -H i— 


-* i —i L4--*■ uu. i -j i_u. c-i r— 

CL. C? r X O Q j; :■£ o S-= Cl. uJ 
1 C Cl o ll £ O sc OIC cc: 




o 

CD 


I—I 

CC h- 

O 4;- r~ 

I— Cb te . 

LD h- .J 
LU CM U ! 
y 

»—<> LU U*l 

i— to lu :c 
id *x t— 
o cc: !— 

cc: lu cu x 


*• ■*■ 


U") CD LD CD ID ‘xl 1 ID CD li .* X* LD CD LD X* (\> LD CD LD '3D LD CD *3? tH Tt* LD CD LTt* *3? uD 'Cx* LD X* LD LD 'ID* uD X' LD CD LD CD UD T *- X tH l-d *. u T -— i'j"i 0 'i 

CM 1*0 M rt in LD L0 LD r- CO CO ON ers OS CD CD* t-) -kH CM CD CD CD CD r-1 x-l CM CM IV* CD ^ *!D T-i r-J CM CM I -*;. r<* vf- Tf v*- u -, ,x» d* .'d 

CM £M CM CM CM CM CM CM CM CM CM CM CM CM CM CM T O CO CD O') I*'-') <*• *** •'*' Tt* ^ ^ uD UD IT!' l*D L“i LD LD LO LO L"!' L"!* LO '-O* ' 0* lD '-Oi >. 4:1 

r- r- r- r- r- r— r- r-~ r- r- r- r- r^. r- r - r ^ r— r*- r- r*~ r- r- r- r-- r- r- r>- r— r— r— r - r- r- r- r - r- r- r- r- r- r - r- r- r- rt. rt. rt. rD. r^L rZ rtl 


co 

r- 

rt 


CO 

r- 


CO 

r- 


co 




: ■UJ 

UD u? X r-H JO X ^ ?'< X X CT-I 
O Ci CD r _i X lO CD rL Cli O r_i 




X 

CD 

1.0 




U1 X 


x-i X 

ro .j 

x 

o Ck: lu 
z lu 

XXX 
d* o 
X* —I C J 


uD CD' LD r- x 
IT.' LD LD tO 
O? CO CO 
Cli Co 'jT' 'jZi 'j5 


feu 


t.l'l 


S O x 

= fel/l3 

1=1 X !.J*I H- 

uariuo 
21 1— x •—• 




uo 


X CD XX f 
-. X ’ 


co 

X 
x x 


ElOIO % . .... X F- .. X i~ 

XX XX XX X X X X X LlI X X X X 

— XX 


Slxxxx -—. — — 

x u'i co co x>x»x>>iiixa.ii>ci£iiw>Xii>CLCu— 

t— XXXXCtiOXCDCDXCDOXXCDOO-:OXXXOXOX>X 
OXXXX>CXXXXXXXXXXXXi-‘XCl.XXXKXXX 

I 


y 

21 CD 

_ m 

SXc0rHLLii= 

1 LU -kT fe l* 4 * 1 

l— |— O If- L2 *— 4 
LU I*“ •—* % 

x x i— x x x x 

X X 

F- LLl UOOK=(«« 
X X O X X X 
CD I— —IX X X DC X 


XXX 

^ XX 

_I U 1 U’I 

ID ID 
Cl. Cl. 



, CC» CO Oh 

'si.1 'sO to to 


>x* 

r- 

co 




K3sOlS2a:P2Li^K:!>!*«!i3SagR!SEl2K8SKc3aa 


X 

r- 

88 




rlUrlrl'HrlrlUrl'H f.J UD X C- uj CTi X X 'X X X X O xH 'X UD LO r - CO X. X X X X X -H C\l I'D i'O r-'i lO f 0 TO fO M TO M CO CO X t-. 

gglggglggggggggggggggggggggggggBSgggggggggggggggggN 


X 

XXX X H- 
X ^ -X -X 
MOOOiL 
X 

_I :>■ Z> X L> CL, 

X £? X X O X 
X X X X X ■-> 


I— I— I— X 

i—* X 

Xl X O o CO 
H- t— •—i CiJ 
QtCZt-rl 
XX >~ I X * 

a.r - 


x 


!5 


£ 


a = -iL 

X Xii£ 

X 

X>>IXCL 





U*l 

H- 

&xSe5 

S 

X 


I 


—. -- _J > X X X X X> |~« I— 
x&xoxxxxxxx 

_i M 3, t > »—■ rr- tk rv\ ck~ q «v 


UJ X 

uvZ2 


UlO^” X . 

X ** 2T fe X f- 

* ‘ ►-* O c<i LU 

_ CJ h~ CD 

5 2 : fe fe «? e~ " ^ w 

Cl. hh L— wm __h* C li 

I— CO CO UJ x-l 
HlUQir tl~ 

O i— *— CO CD LU CD D- U*i 

_I > Z O LU X Ul -.ID 

Ci. CO *-• -J CxL »— C*L' >C HI 



CC* 

r w 


CO X 

x r- 

•ru to 


X Oi 

r- r- 


ril Q iXl 


ci CD CO 

^ ^ ^ Xi fe L 1 * 


a* co co 

r- r- r- 

C0 Ll) ll. 

CD r*0 Cn CD 

ftgoLuNr-N r-- r- 
^inOr-C^iCDCDCDCDUJLJ 


r-r- (ccoulcd re*ro roro r-oooror-o^o r-co rod*u.u_' ul. u. u_ ll. u.Lo cm cd : j^ r - d io cjcj lucd tHxH x-i ^ tHxH ,h h 

^&5&se5E5E5gSSS^SSSS88SSSSSS88S88SS8e8p3$SSSS8SSS8388pS8SPS85pS9SSSS8SS 

r~ r-- fv- r- n r- r- r- r- r~ r- r- r- nnN-P- r- r- r- r~ r-r~ r- r- r- r- r- r- r- r- r- r- r-- r-- r~ r- r~ r- jc_ r- p- N- r- r-- r-- r-- r-- r-- r-- r~ 


Number 22 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 33 


89 




—* uJ CtL CE O rH 

cci —* o ►— o ►-* hr k — Or 

3 Si 8 coco Sob 8 s! 8 8 

Ci CO _J Q U-IODII 
aociuixju Ci 
JxjuiJ^|,nj^j ! xa, ; jac..gce;ci,La.Q; 


Cl. i-i CeC 

QO CO CC CCE CO ©OS 

CCiqm i-h p to *. 1 —i _I 

ci __hl u-ujci -jaru-x ui 


Ci l.il 

iii cq >-1 iccc 

:c -i: o a; P- iu 

| — 1 -l 1—4 ?JJ ' >' 


UUJ —MX —IUIJ.X >11 —I IL XUliJ —IXXi UJ '_' 

Cl CO Cl X _l X X _l X —I Ci'XCi XOX X Cl CM C'iJ X _J 

cijuiJWliiJWJiQ.Jft: Jcco.a.a.^ in c>x crixxo xac i— c>xr-c_i — 1 ~ cl 

xo iDipbEoSooxoNXzEoooNXIrzDxSji-o r-j ujjohxi uj u'i © us 

US DC I.i'l X c_i X X O CL r_i X Cl_1 Ci *“> US *—* X X O Cxi X U'I •—' Cl ■“> IX CO Ci O CfiXX U'I >—■ Cn XCCOOQ X 

_l I- 

© X I— Ci O 


Ci i—i 
► —I i*y i *H 

CmC CD »—« 

X _l X * 


c i— . 
hi >—* x x x P> 
I— co p <*; C.i 
o i1 j £s x c 
CD J« V- 
Cl uj X 

uj i u x r-j x 
x cic x <<■ •—i _j 
i— :o i- x ui 

O CO XI 

JWI- 2 U.O 
CL X X •—1 CO X 


s> S' in © uo S' uo S' in s> uo © dd © u-s © dd s> in © in © m © uo x s* in © uo s> in s> in s* in © uo s> in © in us r — © un © iio s> do s« 

o:> sis> x x c\j cm r^i f <i ititiraouwx x co co j> as © siriHri cm cm r-sos rt- t do uo ms us r- x co co as as asas co © x x c-j cuos 

Cxi I'OCO I'll CO CO CO CO CO CO CO Co CO CO CO C-J CO CO CO CJ c? 't'lt '»• If t)- «J- vf Tt ij- 4l- <1- <J- Tj- 'C If «t 'C O- -X -J- O- *f«t DO DO DO DO DO DO DO 

u.iCOlOCOCuCOCl'lDlCOiiOOic6COOCiiuCliOjCuCOOJtOCOCCiCOOjCDCl1 CO COUCOCOCOii CO CO S' CO CO CO CO COCO CO CO X Si CO CO 'CO 


OS CO 
X X 


CTi CTi CTi 

r- x x 


CTi CTi CTi CTi CTi 
x x x r- x 


§ £31B 8 8 8 § 2 § £ 3 ^ 118 § pi zd ft 8 2I $ 8 81 & 13 8 7J j§ £ 8 ft1 § 8 


■ itmq n >: 
«£= _j _ j Q' 

: cj «x en cn sz: 


> or* oj re ■«*- u“ r 

i xH tH tH xH rH 1 
I x-i xH xH xH »H ’ 
' 0C» CO CO CO CO < 


narix 

■ >—* I> Is- l—l ? 

IZOOZi 

: x S x x' 


' 'ii* IT!' CSi U“ •: 
i r <» i s -o xf xf i 


• <X» CO CC« CO CO 


b'efxpec =u3 e a 

«.« X :> > x 8 X X > X X ® «’ H C " J 8 

!§££S2&&ggg££3ggg88S8g 


I lU 1,1 I 

88 ,^o 

x O uj ui x 

X. X X 

jS t G 5 3*: X .8 

--- uj m xxx 
XX . P X 
U'I U'I Ci Cl CO 

-J CD S * 

O Ci^ LU O CO 
■^LuLU-^U. O UJC'iJ 
1X1OZC1O JCOtH 

#*■«•■«■***** 


:T. Cl, 

r- r- 

:X« *JD U. 


LL. U-. iJO T : Jjkt J II. 

r- 't <S' cd 'S* u. 

EJK:^£3&S!n§S^£aeaiiFea!2Syj®u!s^eJWS^KHiEaieSfcS8S8}3?938?S 


! Xl' -■■■- 

X uli X S X rx s£ ^ 

>—H 

UJ > *-h :••<: cl. ' Cl. 

u'i o >*}— sr :*c r-j :> 3 c 
.X sr si :< •— o cc: si *"> 
Cic: uj 

lli ic: - 


■:*. ^ cc 
cc o 

UJ 21 CD CU* U'I —I Q_ I> CJ Ct: V- 1— 

—I :.Ll 21 lC J > CC Q CD I— X “> I O 

CJ 2: *—• UJ CL S= CJ Q. 2£ U'I 0£0« 

-J 

# * # * * CJ ■■ 


a X 

UI 

O r_c 

dx"tS 


O X :>C O Zr- 

>— 1 '-.. cc; 

1 — cc. x co cc; 
1 —• rn 1 - c5 rp 
co 1 -. c i 
CO 3 . 

X C'J O 12 
•H UC i<i i-i 
X * !X CO 
O CO !— i— 

x C'j s; 2: i— 

x x x ►—1 Oi 


i3 x 

X CiClCD C'J -. 

x 

o xx x;>- 


XXXi X XXCTlfiZjig 

Cl ^ i tL C'J -. -. '-Cl X .< 

co X r-'i pi x lu 

> Cc; x x 


x X' x X o x s o S' ci: x goal x 
xclu-O-Xecciee u; x > i£ x x O *-• 

O' 

co :=- >• x x 

X >—I l-H UJ 1|J 

o c .1 o o ce: 


S' D*| S' DC' D“i S U-) CO D“.' S' X C'J C O 'J- DC' S' U'i *3D DC' © DO © D“' © in © IT' CC' DC' © ID © uC> CD DD P- © C'J ui © u"> CD D i © li i r- CD U jN- © C'J 

CM C'J C-J 10 r t uD uD ' O \0 cri CTi CTi 'Ji CTi CTi © © X X CM CM C O C-0 Tp ij- © © X X CD CD X f -0 X- CT rf in ID DC' ■ l' ' O r - f - CO CO CO CTi CTi® © © 

us 'x P lo 'X lo ui us x x x x x x x r - r ~ r~ r-- r- r- r- r- r ~ r ~ cr-i os ct-i CTi •:» © © © © © © © © CD CD cd cd © © © © © © © x x 

r-~ r~ x r- x x r~ x r- x x x x x x x x x x x x x x x x x x x co co co co © co co co co co os co co co os os os co os co co os 


co 

j\, 

CD CD -Jj b“ 

CSl Cu! S' Ll. 

'll* cc uli r-:» re gc «:g «2i ? e 

x in co cm x p p i'-o O 




vy L4- Uk.. ^ 

12!£G 6 


Page 34 

90 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 22 






csi co x> re Oi r- x o ® <ti co r- x c. rr r-- cj x co x in <o re bo o h tH co on x co -h co x ce. r--- c* «-h s> ijj h co cj u _ .< cr-i o m a-. 

'S> r- u_ o r-~ r- co th c o is r-- tM co n- co in **• c o o 'S' X Lft 'S> r - uj in uj s> r- 0 co s uj s> ro o ® r- co c r- cs? co o o r- ® uj r- 

s> xh re an r- ro no co 'x> u. in r- co t a-, co ■*- an uj co le x c-o c-o be u. u uj h h re cc co cc co co x co be uj x op, -S' be rr, co an co re 

s> cc o is rr uuir--ujinu.o co -e- o r- *r r- r- uj uj -a- r- cj o -*t gd ioooh co r- co uj in r- uj co re *r o co uj r-- cc r- o co 

'S> re co uj re oo x in as rr r- r- s> 05 co co co uj co r- be is *h co or r-- co -h co co re co s> cr-i u_ x ',0 an rr an co co s> an or cc co 10 re 

co o r»- 'S> o is C O -e- r-- dr rr co u_ r-- r-- 'S> r •- co r- 'S> o Cj is is -h or Ci p- co co r-- u. o -h -a uj is © r- ixoo- is co co cc co o 

co co x-t re cc mmr- '-o u. r-- co co co cc re -r r- o> an rH o- cj cm h co m cm co 10 * uj co u. u. u. co re u_ r- co co es -<H co -«h ue 

>S' r— uj o r- co r- 0 *r o siqujiciq re s o fo sj rs r- o re s> r- o r- o rs <s> u. o o r- re co rr uj -e- u. r» co cc cj o co uj o 

si rr re 00 co re co cd co co co <nn cj *x co o a: u. *o p- 05 n. co o <c n. o- o 00 co re co re i/e co an -h o ac uj -*h 0- co be *-i ai «-* •** 

S' re o ft ,35 o rs 'Sj co r-t ft rC co re -4 co s> & s> »r r- ucoo-r- re o r- re uqo o uj r- s> r- s, re co s> co <j cu r- o co 

co re co uj re co re co co co u_ r— co an co x r :c co S* r— cc r — o- o Jn n o- o o uj cc «i w u. ui u. <h co u. i-j ern *0 co co ue an co an an 

Q on ilcJ rt.vF o- fZ o r- rr ft r- C ‘ s> co -h re ino re o ci 101;-' c re -h u- v-i c? n to u. r- cc co lu o r- r- r- r- 

si S' re re an u. re co co r e o 1 i_ «r u. co co u* co cci be co o in r co cu in m co s> co u"' r-- be an co r-- re s> ir> co s> an an uj cc re co 

0 r- o o r-.c 3 oN.rn- in co s co u. co r -d 0 r- r- uj r - tS cb. uj r- o c. o o S re uj re cj r- r- in s> -e- Qj rH r- r - co o W cc 


S' 

S' 

CO 


8S£3KD?J3l5^ygatS2!(a88e3?SSWQifclQa£Jifcl3«SffiSS8eSR 


r- xr r-- *jd 
r o cd uj 


&£3Kiaia3;3a£38i 

co S' &:> S' co S' o? co 



CO 
Cl. 

f “1 

ro Sj 

:c‘ co, 

01 Cl 

'SZ i.i'i Ui U'l 
cl 'e o n Cj 


0 


co < 
co Ctcl l i_ 
cc; cd >- 
'bD -J co ^ 


UJ 

-JUJ 

iO 

u!i >— 

~ r > ;— o 

r-. -X *— 

I— UJ r- 

u: o or 
c!« h- ;.j 
O i .r> C-' •; 

uj ~J -•>; 
•. 1 * 11 — cc: Ci!» 
»•—4 C3 

:n _j -z -■<' IE 
Cl. < D*C *—' 


yxui'i cjs 
cc :£ .. . ij_ .. co o i— 
uj cc o3 Sj 

x Ca X X _i 


o d 2 : f 


> >—1 !> '-'"I U*l. J Cl 


X X' 

^ S' 1 £|£ r'i 

i»4*w *s • i— . L % 

j -.a CC S' r- cc 
-J 


>x x :c ' 

IL. 

cu crl CD cd ; 




: cc: 


. U» I L. 


I - J Cl. * u_ O r — 1 CD -> " ■ H '-C > i l. Cl. I— 

ci' <x o o o x fc* ^1 .^1 .j ~j cp: o o i.u 

cl. o x *-> x x SE; cn lc; cc: S ii cc c 5 x cu c 2 


.j 

Cl. 


Ll. 

UJ 

..J 


C»C 

:c 

I— 


x :c 

UJ LU 

CJ 

r-j r-j 

xx 

* * CawE 1 


•3D b"' *2D l/"' X' CD 0"' X* lO O LO 0 |j"i X* u“* r ~ CO CD , .’ -J lO X* bD X* UD CD b“.‘ X* u“* X' lO X' uD *2D C‘*J ( •'.* OD X' OD Ll“ 

[■— ['■- CO Oj X X' CD rH tH •' •] C>j O') , i r>/- xf ■’•J 1 u“» u“« 10 L“» •! O ‘.O T C-- X* X* H C -J C - *J C-O ' D r J~ 'J' T T lO OS iji X X 

Ct r .T Ct ‘--r Ct co co co co v'J CC' o? co co co co co co co •:«:» co co co co co co cr*. rri cr* cr . cr* cr* >y* cr* cr* cr , cr-. a-, or-, or*, cr-. x x 

'-O '-O sO uO Cl* Cw COCO u? X* CO CO Oj CO CC* CC* CO CC* CO CC* CC* OD <X> CO CO CO CO CO CO CO OD CO CO CO CO CO CO CO CO CTt CT» 


cr-. 




'.L 1 

r- 

•f 


•;c 

r- 

X 

■•H 


:c 

r- 

CD f •'* 

w. 


•~J '^u.' J-.H LL. '.-'J 

l:~i x x ‘-l' r - l • U~» lE. >-H x bu o. o X. r- r-- r - r-- r-~ l^j •.»:» rxi r- r-H tH a-. 
:.U J i •- LlJ u“i O lIj L' CEi L-i : - :lI O N- X X« X X ID r-- LlI X T-- O UJ O 



r -cg 
0*1 ^ 
k—< *.£» 

CD rr 

LU rr 
CO LO 


*r -*r -*r Ct_ 


S 

_j 


> si Cu 

I'Ll i—• b- 

Cr: S' U. -J 

ca ^rccaujcsniCL 


:c :c :c x „i 


X CO 






L‘l 

2 UJ 


'X 


u. x S' 

CO- - 


cr 
ca: 


U j i i' b ’ui o uj 


,^i 

:oiy.o 
1 d cc d So ■£ 


XX 

cbcSx 


:i- x 

CO LL. 

lX Ll. 

ao 


ll) x x :c 


, J X . J ►-' I.I'I I.I'I I.I'I ..j I.I'I . j n. Ci-IX 7 j X Cl C> >— 1 X O '''—_I -i- C> , X ;> ,-_n r_n rj O —' C=- K - J — 1 1 — Cl Cl X 

X ox c=- X' x x x x xC' o x or-j S 2 Soo.NCip>uixoo 2 w&b;a 2 $zQSi>[ijC' 0 o ro 

i.i'i x cTi x x x x S' x S' ll ci—iS | ->i?i>-"e£uS_U lEtx-jilJlcx '.n 2 x x x x x j£ i—".n x x x x £■ x 


CCJ 

X^i . 

X 

XiCJ 

X '.n — 


Z 3 . 

V- 


r-j 

cu 


.0 


CO 


.0 

•X 


U“ LO 'j!' LO X* lO -D C**J U“* *D u“* CD u“ OD L .* '7x' u"« vx* UD u“> X* C>J lO *D uD *D L~* CD u .* -3D cO CD U“» CD U“* '^D uD CD UD -HD u*.» 02* C\l U" *3D lO <:£* 

r o r f lo to * 0 *.o • l!' r- r - co co cri cr*» *;d x* hhoj c -j ro ro ro -rr 10 lo • £• ll* r- r^. co co cr-. cr* 00 h-h c-»j c- j ro co Fo rf ij“» 

L.D b“j U~J UD LO UD lO IT) U“.» U“» UD L.D LO u“. lO ' O '-O •.£. lO ' O '-il* *-0 ‘U' lO '-O -aD '-U LO ’ O *-D lO ' O '^l* 'aD v»D ‘-O T— i s — f — l N — T— i's_ r-— r— P— T — P-~ r— 

•X» CO CO *rO 'X* OD CO 'X* CO *X* 'X' CO CC* CO CO CO 'X* Oj CO Oj CO Cu CO CO CO CO CO CO CC* Cl* CO CC* CC* CO CO *X» CO CO CO ‘X* 'X* CO CC* OD CC* 'X* CO CO 


L0 CD LO 

to u:* 'L* 

r- r - r - 
OD 'X* *X« 


cr-» 

IL 


CTl 

CU © 


cri 

a: 


cr , a-, 

r%. r- 

ii_ tDi 0 CC C>J O : sZ* u C jl 0 N- <H 0 -i_ Ll. tH ll,. Ll. Li_ cu 

^ i3 S3Q8 s §2 u & 8 S a 0 re S § I Ce § S 8 »FE Si I rE fe fe bb bb S Ce £ 3 S ^ S Sdb<38 a ^ S 


cr. 

3 


cr-, cc 

C 5 * ‘d ^ 

*•! cu CD _ O 


CTl 


X 
rs- 
Ll. t— i 


*;r* 
r- 

Ll. Li_ 


•X-. 

r- 


Number 22 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 35 

91 





x 

£9 


UJ 

X 


a: 


s 


>—« Ci_ X. 

z> ^ 
e: x o 
i.n 

UJ ID *—4 
Cl. D*C 
►-« —J 

>.n th 
tiii^ 

x lo r- 
( jD cr. <Ti 

GD CD CD 
'.‘•0 CM CM 


h-CC 

3 s ! 

Gi 


_J 
—1. 
5- 


o 

8?, 

U Q. CJ X 
_J 

• ac _j a. eg o' 
xzarpzy 


x 

H— 

Cl 

22 
c££ 

|| 
X 

5 tH ' 
* i—co 


fe 

tH h~* 
LlC _ 

eg x 
SB S 
*“> © 


UJ 

Q 

X h- 
O ST O 

: 12 \! 8 ? 

o ©co 1ms 


►-*_I >~4 Cxi. _| £ 

ssssss 


-OCl 

!8! 


X UJ 

UJ CC 3 I- ,x I— 

© y > oct o 

. rs t-> a- >c x Ln _j 

yH'-ci >; .v a. ^ 5. 

to^sio CIU 

3 CO _J _) 

•J X UJ CD •—«_| •—■« CtC_I 

' c> u_ >c or ?< o ac 

*—• JrjJ 5 O 

U*! tH 


X LO XLO CD 
■«H rH CM CM l'0 

, , . . ■wH rH ’rH •*■*< . . 

CM CM CM CM CM CM CM CM CM CM CM 


CSS IQ 
© CO 


i in CO 
i ro m- 


in co 
n- in 


to 
cnii. 

l— C-J 

to 

■HOCC 

-Jo. © 

ce; u; r-j “ 


3 

oJcjcc 


5 

ac x 


ts. 


EC X 

^-fe© 

o o 

JJX 

UL Cl£ r-J J- O > ’-* CO > -H •-< >_I >—i Is-_I LO 

852?5S8§S3g5£g5g§53£ 


X 

cocccoq 

•-« CO Z> X >—* 


3 o x co x < 


tO 


©in©in©in©in©in©ino- 

tH x cm cm f -7 r -> Tt- rf LO lo to no to 
r<i r*o i'-o r<i co co ro co ro co co co co 
CM CM CM CM CM CM CM CM CM CM CM CM CM 


LO CO CM 

co r- x 

X CO ©CO 

CO liCpvt 

88888 


CO CO LO CO CM 00 CO LO CO CM CO 

r- r- co r- x r- r- co r- x r~- 

© © X CTj © CO © to x cr> © co © 

88888$ 888§8!S§u!ie8§ 88888g§ 


r- 

CD 

r- 

■*H Q cli ou 

Ll. GD ro o 


r- 

CM 

0*1 C-N- 

r '.i © M" 


o o ox 

r~ r- r- r%. 

uj o u_ ox to ai 

x ro O ro -.M CTj 

x ® r— i* co x £i lo x Ci x in 

8 OS u-j O x ■* C ' ^ M - - 


ix^cs: 


iisssicsfcSJEjeis®^"^®®# 


opppxxx^o^xirj.-?^pxco^.pxxp^ 


#*#*** 


o 

U'l 

X 


o 


X 

cl 


*:••»**** 

O lOOI/TNCO 
CM CM CM CM 

Sggg: 


o 5 

o ” 
Cn^x 
_xx 
X o 

| L-ll-l 

cdo'Ti 

x> 

X 

xxcn 

O *H h— 
(— O '-O 
Lo X 
**■*■* X 


X 

Q 

X 


r- 

r- 


9 

CM 


CM 


XX 
X ui 

R_ 

'7i x 
XX 

XX 
I— X 
Lo 


o 


U1 X 


X 

X 


X X 

CD 
, UJ 
—J I— 
-J»—« 


X 

xoxx 


_ O X 

SgjrfS 

^xo x —• i£r *—• e;i 


U3 _ 

X_lx 

>— X XX 

3552 


co a? 
CO cv 


in xi lo in g iQ 

CO n- M- CO G3 X 

i*Ti i^Ci »S) Cp -w—< -wH 

'S' So®® '35 


xuo 

88 

CC* C2' 


u"« r- 

CM CM 


q LO (S- G' 
r-? ro r<« T J" 
”*H *rH tH ’•■■U 
CS> 'ii CEi Cfci 


x! 

y— 
o 
XX 
u. 

I—« 

•!»• O 

tH to 

tcm- 


XIjI 
X X 


555i 


' X 

. h* 

: ui 


UJ 

LU 

cZ 

‘5 


X 

X 

XX 

xD 
OX 
)—■ 
J!/I 

^x 

CD 1.0 


12 

O 


CD CC -J 
K- 

* »-n 


_j r>j 

Cj 

-J 

_11— 

S x 
'O 


'33 in ‘-O 
in in m> 

■»tH tH *>h 
CD C5t' C3D 


CDUD 

CD 

<:d -:d 

CM CM 


GD -H 
•* H ■'H 
a:- ce* 

CM CM 


CM^ 


*—I IJJ 

O 3 r_i 

I— -. 3 1— X 

■<-i x cm i— x y i o x 

* O rM X'Q X X _J L/i 

CO X ^ ^ 

CM X C 


o 

8 


Ln 

XXXI 

xXX 
o 3 ; o 

x •—i O 


;=- x cti Ci x 

T-l 3 X 1.0 x X 

i_l |_ y-, IX X ►-< _J L-l X' X 

2^835p^353S5 
* *• S 


ro U“* '3D U*D GD lT» C3> CM LO GD LO 'S» U“J GD LO 

. * - ■ - • -- --‘ ^*i N N 

•S' <ZD <3D 
CM O'J CM 


g 

IX 


rsi oc 

* 

oin 
CO CO 
CD '33 
CM CM 


X X X Ki 

r. r- co x 

' M- CO X CO 

JSSS8 


X X LSI 

r- r - co 


X X X O; 

r- r- r- co 


xr- C£i 

r- x x 


X X X CM X X 

© xxx r- r-- 

XX© X tTipCCi Cl cc 

NOO X X Cp M- X CO 

XOCIX WifMSujSrlMOW 
~ - -I © C^I x X G X © O X CO CO o 


© © © © © © © © © © © © cm in co coxwH'tr^ r - r- ac ci © ro ini co co co x x x x x co in co x i x x x ^ in x x x m x 

gggggggggggggSfsgggggsgggggggggggggggggiggggftiggliii 


c~-, 

UJ 

uj 

CM 

«3D 

Ci 

o 

ro 

•Ti 

X 

tH 

X 

CTi 

cr. 

GD 

i 

CO 

ro 

N. 

cr. 

vH 

r*- 

H 

CM 

•3D 

CD 

CM 

CD 

r- 

CM 

GD 

CD 

<D 

r- 

GD 

r- 

r- 

O 

in 

CD 

cr-i 

cr, 

a-i 

CM 

LU 

lO 

«T» 

CD 

r- 

Oh 

CM 

•jD 

U_ 

Xi 

GD 

o 

rf 

CD 

r- 

H 

r- 

r- 

r- 

CM 

•H 

O 

r- 

GD 

C^l 

O 

ro 

UJ 

u. 

U- 

GD 

uo 

ro 

U. 

GD 

UJ 

•D 

•vf 

't* 

Cxi 

'Ti 

ori 

o 

CTi 

«x 

GD 

X 

X 

UJ 

CM 

GD 

CO 

Ci 

•uD 

r- 


•X 

•r 

ir 

GD 

r^. 

r- 

U- 

p % 

CD 

•3D 


GD 

tH 

CM 

X* 

r- 

CD 

UJ 

•3D 

CD 

CM 

•:c 

CM 

•3D 


cc 

•X 


•3D 

ID 

•siD 

X 

CTi 

LO 

cr. 

© 

UO 

UJ 

r- 


ro 

CM 

CM 

GD 

U_ 

•ID 

CM 

L L. 

•3D 

tH 

UJ 

•S» 

r- 

UJ 

r- 

© 

Cl 

r- 

GD 

r- 

r- 

cr> 

rr i 

•:s« 

CM 

eZi 

-•H 

CM 

LjJ 

I s — 

X 

L*> 

X 

CO 

CM 

or 

CO 

ac 

r^- 

CM 

•3D 

O 

CM 

‘3D 

CM 

o 

CD 

CM 

Ld 

U“.i 

r- 

X* 

u_ 

CD 

CO 

CM 

o 

r- 

X 

ClD 

cr-, 

r- 

X 

•J-. 

r-- 


Uj 

UJ 

8 

C. 

a-. 

r- 

X 

r- 

•X 

r- 

i 6 : 

X 

X* 

81 

CM 

ro 

o 

8 

r- 

lO 

X 

tH 

X 

r- 

ci 

c£c?i 

eg 

cr*. 

O 

8 

S3 

'X 

r*- 

x< 

X 

R 

•cH 

'3D 

FC 

X 

r- 

ro 

CM 

88 

m 

X 

555 

‘4D 

UJ 


it 

8 

S5ai5fe5 

r- 

uo 

tH 

o 

ss 

X 

X 

8 

ro 

CM 

5 

'DD 

GD 

CO 

© 

CO 

GD 

0? 

© 

CO 

© 

CO 

© 

X' 

© 

CO 

© 

o-, 

© 

co 

© 

CO 

Cft 

Ch 

x 

az 

CO 

m 

s 

Q 

o 

Q 


UJ 

X 

X© 


tH 

tH 

CM 

5S 

r- 


S 

S 


CTi 

r-- 

15 

gS 

r- 

15 

Cl 

r- 

F5 

Ci 

r- 

Ch 

r- 

15 

ChS 

r-x 

r— 

5 

55 


Page 36 

92 



Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 22 




UJ 


c£ 


cc si 

■ —J Z> Cfc! I>_I 

< 0 : 02 : 00 : 


•x a; 
^ _ic£ 




cc o 

si CO £ X C5 03 


o 

V- 

ty 


& 


* ^ 


10 

<T. 

ON 

•:m 


O IT* IS* 10 © 

CD CD rH tH •.'•'J 
CD CD «3D '3D CE* 

n iX» ro ro r>o 


OZQ 

je*- e 


to co in 
cm rere 
to cci © 
re re P) 


_i>cc:r j 
« o O as 
oc £ 0 ►-.• 


©in ©in 
*t «*• in in 

CO CO CD CO 

I --0 (■'’> re re 


© Cl. Cl. 1— 
£££& 


OO 
Cd >■ 

* * 


3 d O 

mud a. -'' oc ■■ 

X © _J © 

©I uS —I Is-1> •— 1 _ICL M •-« 

-iooxxoclncl 

_i£e: JCo.u(jcj(j 


o 


' §5' d' 


O CO 


x a: o-a 

r g' 3" g 


>piooxa:oiiNCLNiipsjcLNa.NiirgCLNa r NCLN 
o£ JECJuCLOCJCJCJOQOU CD CD CD CD CD CD O CD CD CD 


3^ 


■s in © in co T-t in © in © in © in © in ■© in © m © m coin 3 in © in © in © in © 

co '.ONNQaicst-iTH cm cm re re ■+ -m- m inso co r- r- co co as as © © th *-4 cm cm re 

3 CO 3 Cp .-4 .-4 .-4 ^■^▼4*4'H .-4 .-4 -H .^-4 tH »4 «-4 t-4 »4 --H .-4 -*-4 -«-4 CM CM CM CM CM CM CM 

re iv5 re re re re [vj re re re re re re re re re re re re re re re re re re re re re re re re re 


tn© 
re '+■ 

CM CM 

re re 


CC 

££ 

85 

© o c5 

US _J 

_J rj 
ui >c © as 

>—i_lO") 

■* 

cm in © in 
e- ^ in in 


l4J 

fv 


CD 

r- 

in 

vt- 


5fcWK!SfcWK!Sifc8asslsa8 



© CC' Cl 
© r- r - 

388 


r- r- r- r- r- r- r- r - r>- r- r- r- r- r- r- r - r- r- r- is- r- r- r - r-rs. r- r- r- r- r-- r- r- r- r- r- n. r- r- r- r- r - r - rs. r- r- r- r- r- r- r- 


o 


s 


a-6 

X UN CD 

ui^tDcc 

0 *i Q to C5 

i— Cn £ _! 

_J_J O UJ© 

_j is- > _n~ is c_i uj i— >—i cu i> i—i o 

OtCOOIUllOlMClll-EOClll-CL 

- u = £ui 2 e J' 


Cl °~~l— Cl. 

_© Q i 

m. .J 


UJ 

“3 

cn 

r> ♦ cd 

■—■ ww r— «_i uui i— l*_ O CD *— 

fi= «.n ‘XI CtC JC UN UN QC SC «7i UN c*i 


CD O 

ct X 


CD UJ 

a? x 

> 1-4 CD CD» 
nrocDH-a-ja 
cn 2 c UN UN CD CD c 


c^: 


5 CD 

?• r~i on 


ro 

4 - 


e: © © © © -jo 
occyi :£ © © _j 
i uj © x © JE 

•• ”?»• I'l I i*» i , 


_l_i_i ai; 


© 



n © in © in © in © in © 
’■-j- to in •.£> id r~ r**- co co cr, 
e-, ai as a-, ai'T, gs aS as as 

CM CM CM CM CM CM CM CM CM CM 


lOCO 
■rf r- 


r- 

* © S 

»-4 © © as cm as 
iHOum C'j o 


gj O -gj O tH ^o 

co 51 is- co co ul r- © cr, lu r- co as uj r- © u. a-, in in in Si ‘ii uj r- r- r- uj r- r- 

Komu. f -15 re © © re u. r- © re © re o cj © uj cm © P-ossirir 



uS _J 
I— UJ 

Dal 

tH CkJ tH 


tH lU CnI ro ^ L~.l LLi Ur 

_©©©UJO_ ._ __ . _ > o 


© 5? 

1 1 'ID' 

© ¥ . . 

^ i-* a, 1 —■ 

uc © © iz 1 

>Sl © © -. uc u. -. © _ j o o © 0 

_ © r-4 CCi xH >© '© © '-L UT lc 

© © © © © ui '-n © i • 

•-< © r-J hr Q 


o 


r -l CD © 


© 

© © 

© ©1 I-. I> © »-H 


© 

c .1 

© 


© © I—I 1— © 

^©-‘se© 

- us 


1 ] S a. S n cl ai ii o us u S u iri u in Q n ‘ji ct © ffi e; u 'i Ji o r© u r a. 'j"i o u £ £ u. o 1 j- 0 c. £ u cn s: u n >- 

♦ K- * ii! *■»•»■© * * 0 - * 



in © m © tin © in n- © 
© © th cm cm re re ri rf 
r^ is- iv- r - (v- r~ K n- rv- 
CM CM CM CM CM CM CM CM CM 


CO co 
asN. 
a,© 

L 0 © 


co 

J 


CO © © U_ © © CCj la_ CO Ll © O 

r~ is- r- r- r^- r- r- r- r- r- r- 

© r- co as co co © © © il © in 

I r. I r s r. 1 c s 1 r s .• *. 


© cm © cm © cm © re 
O CM O CM O CM O C'M O CM r© C< 


r© 1 © CO © © 

r- r- r- r- © 

f© © CO © © CO © 

r-s © re © .. m © © 

4 I 1 'L' © © hi: © © 

•© © sj- 1 © © ■+ 1 © © © 


a 8 s-o 


CO © 

r-r- 
re © 

©^ 

G CD 


r- co 
lo r- 

CD Q 

dlsavj, 
■H 1 © © '© O 


O O CJ CO © 

r- r- r- r- © 

co © cj © © © © 

m i-1 re © cm © co 

©©r-©©©©© ^ 

0 ©’* 0 ©U-'©£i v-l 


© © © © r e '© © © a, © © uj © © ll cm ■ 


© ’cf o © 

Io CQ X ® yj 'H Tj 
CD 


Number 22 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 37 


93 




-U 

•:c 

o 


as 


oidcnlco 

iLl _J 

ct; r> qd 
►hXO^ 1 

^ co 1 C ‘-n 


UJ 

H- 

H-* CD ID 

Cr‘ Cc. 

oji-S 
r-j ci. uj o 
cc: ►-> cD Cc: o 


3cn 


UJ 

pt! 


:c 


s 

585 

to Z3L 


o8 w 


Q CD O. CD 

V 5, *^1 


■CD 


uj ; 


O 

cc 


CD 

oc 


lO 

CD 


CD 

CD 

CD 




co 


CO 

CO 

CO 

Ck. 

CtC. 


Lt 

CXL 

c*: 


Ju. 

li Z 

ns f— 

~ir 

OC h~ CD 

act— cd 

pc! 

►—< 

UJ •—i 

3L*U! 

,—, 

CD UJ Uj CD 1_iJ O 



Cli 

—4 Cr: 


O CxL 

O Lr. 

►~t 

H— 



—l 

—1 

Cii 


Ci^ 

r~> 


5 

_1 




UJ 

cii _ 

. _. -Da 

X . J _l o C xi O UI o 

M? -j u. _j id UJ ;■ I 

o cc -. fie .. £r i— i/i 

uioa w “i dt! 

CC O _ _l _J Cl. 


O Ll_l Q Cl, 

ttSSS 

cccc 

_i_i_i 

: cic 'X —j —i_i 

1 2 t— x x x 
i ►—< lo o o 



ij_ 

i's- 

i.~» 


CJ W Ml IQ ax 
Cxi N. CrJ CJ| IL. &> o 


o 

,1 


Cl X CO U- UJ 

r- o r- r- r- 


r- 


—. UJ UJ o 

r- r- FZ r- 


£S8£88 as888838888888888838 


) rf r- X 

jg&ag 

r- r- r- r- r- 



8ft 8 


C5> CO Cl Cl 'Cl CO 
■j? r- r- r- ■& r_ 
■S' O r- Ml llI iXi 
'2. <§'Cy ft' ■£ 

? 1 sda?ld 


•o co o r- *x» cis cm co c> co 
th r- r- uii r s- r - r- r - r- 


r- cc* 

lO 


CD 

r- 


Ch 

vO 


oi co co ro co co r o co co cc* co ^ u. co ii- •• o ^ 

'*LJ ^ if.» •H tH y“i rlLjLij. , CC x-J Cp u_ C3 Li_ Cn <f* 

HiJ' r £'HuU'd^iilR lO '•J.* x-j L .• 4-j *H 111 Uj *.*'J LU T-i LI .1 Dj 

HUGH o O nH O O cji CjJ CM tH UJ O UJ CM <dJ CD CM -H UJ O 


£D U* 'A* 

r-.: t-, r- 
}-i J P> £> 

LJ .» U» 'Si 


vH Uj cm ul» CM tH cli lu x-J i^Ti 
LlI '7m O CM ‘CD tH CD Co Lot -U' 






tH 

- 

CM 

CO 

ro 

lO 

CO 

in 

Ul p 

K— CtC dl 

o 

. Cel O 

o 

Oi CD 

o 

cc: cd 

p 

cc: 





Page 38 


Dr. Dobb’s Journal of Computer Calisthenics 81 Orthodontia, Box E, Menlo Park, CA 94025 


Number 22 


94 



•M 

Uj 

-il 'uJ 

i '.n o cv: 

i (J O 

; “ a ;-1 


I y*l U*l 

•( cl- 

_J 

: oc x _j 
■ isi—x 

i —. i.n (j 


oi ;j cj 
J x 


cd &! 

_J 


5ii^e5oSE“£L 

V V \ \ 's ■*. \ v 


-1 —J W4~ -• I _I -1 _| _J | I _I S \ -. S •. S S • 

__J —I Cl_ I— UJ —I_11—•_|_I •—«_| I _J X I it—I II— UJ 

■X' cc ar _j X' x x r-c x x x x x >' cc o cc a: x x cc uj El ns dk dk 3e ;e ue 3; 313 3t ■ 

c-i•-> o cri 'j joo J u j o j o iuuu_iuKixoooaaoaaooi 


•' •> X '• 

U.2 Ul 

r|i- y. | ^ 

**• ••• *!D ■*• 


: Z2 r£ CO Ll 3 

iOOCji-u d 


j£ sQ «! •- T » CJ U. T .J LO CO CT-. CJ Li. CM ID LO CO CO UJ xH rt f-__.. _ .__ ... . __ _ ____ _ w ____ 


CD UD CTi O U. C-J u7 CO CO O UJ ® f\l rf 1.0 OD X CJ UJ © C’J <t CO CO X £0 . 


Irll 

CD O 2i 
(■:< 2 

UJ 

Q-r-JCC 

CJ “> UJ 


•—1 r-j c-j ' 
XXX' 
UCtUJ, 


I LU& 
I O UC "* 
; x ci , 
1 01 cj _J 


: cc rr to 
r cd c-? d 
-e 

UJ 


-£Cc:uj 
rHoct:: 
cz 1 ll. 'X 

o i.n t 
x uj 
ET X X i 
O «—• I 


J vH uj CO Cp 

.' CO 

: o 0£ cm tie. to ct 
oc 1 — ai!— xi— •; 

1 Ul O UJ © LLl < 

j cj o os c ac c £ 

Ci X . J Ci —I i —1 —I £ 

J X —I I -J..J —I ..J 

£ UJ (CNXCNIIt-i: 
: -2 j . ji CJ X' _J CJ Cl£ -_l '£_' IX . 


CM iX 

to it. 


lt.i cE: 

CD!— 

CD 1— 

CO 1— 

CD r— 

O UJ 

O LU 

sa 

O ID 

CD d» 

Ct CD 

CD CJ 

d —1 

d —1 

CU_1 

d d 

—1 - J 

d —1 

—I _J 

d -.1 


1.0 

cc: 

LU 

...1 

iij 

cE 

xx 

X 

: 1 u :-c u_ 
' CD IX U- 
: 'X cc o 
i.n ~j 

. Ij“l 

: tLi o c»~ 
• nr. cd r —■' 

«,*i 


Cr. CD 
O — I 
—1 :< 

r-j cc nr 

•—;« CJ 


O Z£ X 

CO X II. 

Cl. 1.H K-4 

in o cu 

1^1 cj 


U“i i/*.i GD lO CC' CS* lO CS> C5D Li“ U" 'JD U“' CC* LT.« d' xH iO CI* LT* d' !j~< '.il» f - .;ri u“‘ •!£• U“!» d* lO d‘ L" O U“» CC* H '.'\i u“ d' u"> L»“' O IO LO d U~» d» LO 

d» rH .h Cvj c j c-j r<i -^r -j- to co »:o cri -:d cd to ir« r%* r- r- cc* o:* or-. cr*» o-i cr-, d» d* tH th .;->j c j r-t> rc* -*■ u“* u** u“» vc» vo cr> <s» c-j »x» ro ■»jr uo U“» 

c j c j <-j c j c-j c-j c-j c-j c-j CM oj cm cm i'-'j r *> r<i i-<» r-<i r-'« c-*'» c-o r<* .x» r-'i xr - r t- -c t- ‘t- rr vc to uo J •* t».»to or* u“« 

Tt ^x*- T*- x* 1 .* xf •«*- -.f r-j- Tf x*- ^ X-J- -vf '«*- x.r x-^- Tf xi- -«f -T* v xf xj- -rr ^ ^ '*■ vf x*J* xf ■*** xf rh •«*- xr 


uJ wL O II. uJ LiJ ID O u. ID lD CJ CD 

S: £: ^ ^ :5 vj yj ^ S ^ ^ :|i 

X X aulO cS TH ij 1^ f-^i 2S th Cj cil O 1 • ' 

u_ cj r-'.i x o o x x i_icj ® cj cj o x• 


r- co 

u*i r- 
a i r-D 

XI -v-l 

Cj -n-l ... OT'i 

X tH O X' 


I.J. LU Ll- IU 
r- r- r- r- 


Li_lU IX £U 
(■- ■ - r- i"-- 


r ■- Ijo cfj in x uo cj v~> u. 117 o u X; CO \t Li. 

£ s x Se s x a x a ys» a a «>1 .x a a x c; . ^ ^ tb 

C J O d' 1 CM O O CM O O CM O O CM d> O C- 1 d* U. CJ 1 • d* d' Ll. 


k ,J ^ d' 

*> n: k— r o < 

^'SxfSlx * r ;i 

}— J‘l O Cl. Ci ij‘i Cl. LU 
CD -Cj 

•X Cl. O X *-* Tsj . 
H-ET^DCLZrX 
IJV^CLZDOOHK 
•X 

* ->r Cl. 

CM LO * D d» iT» 'x:» U") d* l 
x^- x^f -rf- L" 'X' '•D r — t 

CT7 CT-, CT-. 'Ti CT-. »7i Cf-. CTi ( 

r-o r- o M r o r<* «* *:• r *? js*> r 


CD rH CD 1 
xj* cd {— DZi tr t 

2 $^S 2 siS£« 

l. Cl. di_Id —I» 


. *--* Cl. 
: cl. r-j sr 

: <_i —d —. 


> to d< LO 

• CD CTi • Ji 
i CT-* 'P^i cr-. 

• t o Fo r <> 


LO X «x : 
nr -Jo - 
•:c 
cl. 

d io<£» i 

O OH ’ 
CD CD CD * 
Tt xf -wf ' 


IU-.IL, *—• 

: o sr i --.' cd c 
• CL. O 7* */l *■ 
•X 
Cl 


' (jO'T x ? iO» L 
i CD CD d* d •: 

X*- Tf 'C^ Tf , 


@ 

. r- & x 

ouix ii. 

!s!hi sx 

I X X »• X X .H X o 

x a: xx 

I X Uicc I-I I 
■O.E'MOZQ-N'tl 
: —> —> 2 2 x U —> 2 1 
XX X 

Cl Ci_ Cl 

i lO d* u~j d* tT* O L“> CD l 
• di *7S CTS d* d* xH tH CM •! 

i CD CD d* x—I xH vH x~l x—^ i 
•xfxfxfxf-M--^f-x*-xf' 


LD d 

5 ^ 5 ==-; 

. :•- Jl 3 x co 

,a-ffl>> 
iscto Xi 
. i— e: a: 


I— LUi 

i—* X 

._l O i 

CL. CJ £ 

oi: 
_i < 

_11— oi < 

xxxi 

uceii 


> Lil Xi Ul' 

- r- co X'' 

I .H -H —I ■ 

- •*■ *r ■ 


CO lO £ 
(JI CTi (Jl > 


Ll_ £j O 

r- r- r- 


£JLU Lj_XxXXX 

r- r- r— r- r- 1- r- u- 


Number 22 


Or. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 39 

95 






.“I tH 


:c 

X tJ i 

re ssj 

>3'__ 

X I x sc 

.Vi yt* CO 

r o r- -h U"i U*i CM CM CM CM CM CM 

—, .~-s r-ij vd ^ 

;'3 CD r-t in '.o ^'i? 'i 1 S o 

'*] iS l ” J in d d x> ixi in co cci cii 
i>; .J 7C U. US '-‘1 o x> ra o *H o 
.;_. i_i in us Ci£ D- ct cu CU cu cu 

ij-i © o id x< id r- x> u~« id x> us. 

«s! in in iis> m id in iiD on in u~< in id 

cri as as iTi as or-i 5s os a. 5-. a. Os as 


r:> r- 




x 

Q X ?0 

X'Lu x -r 

•A' 'S'li ' •! 


iuX 


'- ■•• n *c CO ® S' ~i X ifi vo ID '3 
CO I— • • U. 10 LU IU (21 (21 •■£ 


X X 

XXlL'aJ lu CC X 

y? to ‘-I- 7t X, X t X r r fvj X 

— gi rH I. L_ ‘MJ > 4 lJ •i Li~ •-*-» Ch O _ 

(Ti os r— t-i _ i t o c-3 r ■- *+■ co t co 6s o 


© is? 


vH l 


X 

’i x x 

•± Q X id 
X ”• i—l CO 

Cur? ‘ J ' ‘ 


c- j ' c\i;d " -i co r- cJ ; f.; 

_ -- ,___. :::• as :d .21 sd rs> 10 sd 

UJ IU OS —I —I —1 C 2 > cjl 13 (21 Cxf ”i o X' I U CJ UJ '2b X' (2* 20 CJ 20 (5 1 

X '. 2 ‘ '—I I— (5 1 d> © IU UJ UJ UJ llJ CJ LU (21 IU UJ CJ UJ CJ CU UJ (5f IU 

•xi uj i— x xiu xiUJ iu iu i.u 'uj;u a u* lulu iu 

LU m( 3(-(JQI U'nHOJLi.CJ U.I (.KC li_ X 2H Cl.. 

:z is or iu us co co oh r-j sr :n us cs uj iti-zccci-ooou xi: 

Cl. US O U.I 1-1 Ci_ .-.O’— X> CC >X © O I—I O —■ I— X* ■—i I— US CC US 1 . J UJ CO 

us ci_ ju ;c x us :■< ru cu ct :>- x. i-.u o _i x „.i x us o .u us cu us uj u_ cj_ o o 


ID CO ID CD in X* iD 'S'»li"» 'SI 1 U“* '72' L~' iXi US' US' -X' 

C'J C •■> CO ^ <#• ID u5 X> CC' —I .—I ( J' (' US' in (Li 0S5 

ID ID D Ip US' US' uS' lO '.o 1 0 u'l 'X' '•£'' O ' £> '-O r- 

CO CO CO vO 'X' Cu 'X' CC' 'X' CO OS CO CO 0.1 Cu CO CO 


'••J US' CS» US' uS' X' tH X' u~' X* US' X' C-.J i'O US X' US' X' US' X' US' X' US' X' *X> US X* US X' US' X' US' X' 

SO-IH C-.J X' CD tH i—I C-.J c-.j CO CO CO CS' CO 't- -<J- UD IjS '.o (O r- I 4 -- CO (Cl 'Ji CD CD -rH CU '(C Tj- UD 

- r •- r-*- r — r — x* x< x* x> x> x* x> x> x« x* cd cd x* cd x< cd co cd x* x* xi C7i .A --i >-i —H .H --I .,-i 

:o c.o Xi co co os cr. cr-. as as as a-, a. as as as cr. cr. as cr. as cr. os cr-. S-. .rr-. os a. ci. as a. a. cr. cr. 


I— r-0 1.-0 lu Xi LU X 1 lC I.U X' Ll. X' i 0 XI 

CM US' CM (M lu- 0 !u. CM -'f ro ID CM 

X' 1-0 u_ X' US Si cr. ID. X' X' CM CM sj- CC 1 ll. 

M US' sj- ?M X' to U ' CM CM US' S> US' f0 lu 


UJ Lu US U- X* X' 
JO MluOJ 


:c _ 


5? 


& 


•?»c->■ o^rcvijpq uj ^ujt~ptti-' it.^:uj«coh-_ccuj2i2ru-2:3x:»- q-*Il3uj‘- nac 

I ^ I M-V pi> Sz O I?i a: > O Lu O o O 1/1 X > O - Lu cS 2 lU22 Lu 3 tn X 


o 

r.xxrxaDo: 

) a cj u o 

CM 


CD 


tH 


joScjOCioSciS 


a: 

UJ 



Q 


CO 




:zkzk: 


LU 


cd ir> «d m cd to «x« in <s» ur« cr* cd u~i »d in -d in *.d to cd in «x* ud o in o ud cd in cd in cd in cd in cs> in cd cd in cd in rr, m cd cd cd in cd in cd 

th cm cm ccj re* ^ lt« ur* r- r- o cd cm cm r o re* rt- •»** i/* 1 in \o r- cd g:« cm cm r-o ^ <x> cd tH t-i cm cm r <« in *X' ohh cm 


5 J ^ yH r~l rH tH CM CM CM CM Cm CM CM CM CM CM CM CM CM CM r-0 (■'* M r - <i i'<i M i N *C* O I s ? C O vf- 

'.U «.JJ U' *-u Cu Cu 'J,‘ I.JJ Cu UL' CO *X' CO 05 u-i CO CO CO CO 00 CC* CO CQ CO OCi CO COCOCOCOCOCOCOCuCO*X»CuCO 


C\J fv Ci* 1-1 CM 

,i -- rr lO L»D UD iT' U? 

Gj Cu CO CO CO CO CO CC* CO 00 Cu oi 


Ll H IX; to r-'X| CDcTj Ll. -H iX» LO r- CO X O llJ «X« CM Tt L£| o;i IX CJ tu O CM «f '-J CO X CJ UJ S' CM *X' CO X CJ UJ CD CM Vf ‘X* CO Ch COOlLrl 


Page 40 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 22 


96 




CC l 

r- 

ro 

Tp 

xH 

X 

't- 

lLLi 

tH 

r- 

X 

d. 

in 

UJ 

•X 


•7-i 

do 

'T 

o 

CE' 

'H 

xH 

r*. 


CD 

© 

r- 

10 

rj 

H 

cu 

r- 

CJ 

'•D 

r- 

CJ 

dS 

CO 

CJ 

CD 

O 

a*» 

CTl 

rri 

x 

CD 

•X 

cc 

CJ 

in 

rH 

X 

%Zj 

•X 

ch 

X 

da 

m 

X 

re» 

•X 

Ll. 

c-»j 

ID 

re» 

rH 

CD 

X 

rH 

ro 

rc« 

ix 

CJ 

© 

x 

rt 

cm 

CD 

r- 

O 

X 

Ll. 

CJ 

CJ 

r- 

re> 

r- 


O 

o:» 

d:t 

T - 1 

os 

LU 

.• *• 


C_a 

u-> 

-r 

Ch 

•:c 

CD 

U- 

c. 

UJ 

r-> 

o 

cc 


•D 

*■'^4 

nz* 

re» 

O 

T—1 

•X* 

r — 

CO 

u 

r— 

CJ 

Tp 

CJ 

Cxi 

CO 

r- 

CJ 

u_ 

•2D 

r__i 

•d 

ret 

re> 

r J 

CO 

CD 

CT. 

CJ1 

CO 

ro 

d 

UJ 

. j 


Oj 

CO 

X* 

X 

C J 

Li.. 

X 

cr-. 

•X* 

tH 

it_ 

cCj 

CD 

re* 


O 

rx 

ix 

un 

l' *1 

x 

CD 

»*,-*! 

r- 

r- 


•M 

CD 

r- 

o 

.j 

CJ 

X' 

r- 

rji 

r- 

1^1 

r *» 

rH 

in 

’•n* 


© 


CJ 

UJ 

•»S%* 

re* 

ID 

05 

cc 

l L 

cD 

cc 

U. 

UJ 

'j- 

Id 

CD 


iD 

X 

X 

© 

C 

O 

•j. 

■' 1 


cm* 

rH 

r- 

•!ji 

CJ 

CD 

r- 

Cxi 

U. 

r- 

CD 

r- 

CJ 

CJt 

r-~ 

UJ 

rx 

r-'» 

o 

8 

cr-. 

ro 

•X, 

ro 

u 

CJ 

UJ 

rx 

& 

ro 

Li 

8 

in 

X 

ID 

8 

S8 

8 

UJ 

Li- 


8 

ij 

s 

.x! 

yn 

iH 

d2 

UJ 

UJ 

X 

Ll. 

Q 

cj 


czj 

•n 

UJ 

CO 

ro 

•rS‘ 

•X 

re> 

Ul 

do 

o 

ret 

.dt 

cm 

X 

'* 

X 

LL. 

fx 

LO 

o 

rx 

in 

CJ 

X 

ix 

o 

O 

co 

CJ 

o 


■CJi 



•d 1 

ft 

vH 

T 

X 

X 

X 

P0 

ll. 

i- i 

CD 

x 

da 

in 

UJ 

cc« 

re« 

UJ 

r 

^r 

u_ 

.• •» 

dj 

id 

cj 

X 

Tp 


r- 

x 

CJ 

rx 

cZi 

tH 

r- 

o 

X 

px 

Q 

•s* 


'X 1 

CT| 

r.__ 

CD 

CJ 

r- 

•2D 

co 

•2? 

co 


co 

•2D 

co 


05 

© 

co 

•3? 

co 

CS» 

«*i*i 

'2! 

CO 

rt'i 

.... 


C«D 

•s* 

CM 

CM 

lO 

re* 

Tp 


in 

m 

X 

X 

rx 

ix 

CO 

CO 

ai 

•T'i 

•± 

X 

CD 

cc! 

•iji 

f •» 

d> 

UJ 

UJ 

UJ 

UJ 

UJ 

UJ 

LiJ 

UJ 

UJ 

UJ 

UJ 

UJ 

UJ 

UJ 

UJ 

UJ 

LD 

UJ 

LU 

LU 

LD 

LD 

UJ 

rx 

rx 

rx 

r- 

r\» 

rx 

rx 

r- 

rx 

r-._ 

p-- 

r •- 

px 

pX 

P-- 

P- 

r-- 

r- 

r- 

r- 

P- 

P- 

r- 


U- 

•H 

di 

ll. 

■X 

r%- 

r-i 

X 

LT.» 

•X' 


u 

X' 



'X* 

•:o 

tH 

xH 

x> 

-H 


•X' 

UPt 

IT* 

CM 

CM 


r» 

a. 

?j 

r- 

'••■J 

t 


•: • j 



•.-•j 

Ll. 

in 

rP 


•:-J 

-p 

C'J 

rP 

*fxl 

*P 

in 

*5* 

TP 

UP* 

■*p 

■H 



vdl 

•X. 

•Xi 

•d' 


■x* 

Ci‘ 

•-X* 

•Xi 

•T. 

CD 

tH 

r:-i 

up» 

■J-l 

•X' 

LU 

CO 

xH 

rji 

«i 

ISI 

CM 

•X' 

X 

•*P 


UJ 

Xi 

CO 

r- 

•:-j 

C'J 

C-J 

•>J 

in 


in 

•:-.j 


•: • j 

TT 


CM 

pP 

■^P 

CM 

CM 

CM 

CJ 

UP* 

ret 

PP 

ret 


X 

li. 

X 

xH 

X 

U“.t 

X' 

X 

ue« 

'r 


X 

X' 

XI 

CTi 


ret 

LL. 

•X» 

X 

re» 

cr. 

CT. 

X 

cr. 

CJ 

X 


r-'.' 

r- 

'.-.J 

O 

CJ 



c-*j 


T T 

ue> 

re« 

rP 


in 

pp 

LO 


CM 

■•P 

IO 

to 

IO 

•p- 

IO 

to 

Ll. 


LD 

ret 

cTj 

X' 

o 

CO 

•2? 

•X* 

•d* 

•X» 

CJ 

CTi 

•X' 

Up* 

U. 


rP 

r- 

in 

Ll 

n 

UP* 

xH 

re* 

X 

•x> 

CO 


1 *- 

•j: 

f__i 

CO 

Cxi 

yr 

ret 

•:m 


•;-j 

-+ 

C-J 




U*i 

b"i 

U“> 

UP* 

^P 

U-) 

tp 


n- 

u_ 

CM 

CJ 



H 

Ll— 

»et 

X. 

-■i- 

X' 

iC» 


X* 

in 


uP* 

u" 

cv 

U- 

CD 

•X 1 

•X* 

r- 

UP* 

CD 

CJ 

re* 

«x* 

•X* 

X 


•.IT 


f- 

•,e> 


UJ 

•. 'J 


•.•■j 

T- 

to 

r-c* 

L) .• 

•'t- 

u 

LL 

l v J 

*.-*J 

re* 

u.' 

pp 


M- 

ul* 

X' 

CJ 

re* 


dj 

•X. 

1' • ' 

dj 

LD 


m 

ret 

u_ 

X 

ret 

d» 

Li- 

C*»J 

'■p 

•X* 


UP* 

■T. 


CM 

CD 




X 

ret 


•d> 

•_U 

id 

o 


•.■•j 

-j- 

Li ^ 

Li— 

r T 





11 

CD 

PP 


UP« 

•a) 

uP* 

•f j 

IO 

Jm 

Pi 

u. 

lO 


X 

•:r 

•X 

•"Et 


•X 

dj 

i H 

•X 

•X» 

•Ti 


•Ji 


r-7 

CIi 

Li 

X 

X 

io 

CD 

|T, 

•p 


■X' 

TP' 

XI 

r- 

'.-.j 



•Ji 

CO 

'T 

’X 



T 

i •.« 

U1 

'.■•j 

irli 

•:-.j 

•r 

U ' 

X 

T 

i]*i 

to 

i’-.j 

CM CM 

•Pi 

in 

lT.i 




ro 


CD 

iH 

o:> 

•X 1 

CJ 

LD 

CO 

•X' 


in 

H 

C\J 

tH 

© 

'•D 

X 


X 

X 

dj 

•X 

•x> 

CO 

•ji 

o 

1- 

Cu' 

Q 

•,\1 


'j- 

C'J 

TT 

TP 

(M 

l>J 


pp 


If? 

PP 

© 

to 

u. 

rf 

^P 

Ll. 

CM 

n 

re> 

r- 

CO 

X' 

CO 

CE' 

CO 

•3T> 

CO 

CD 

CO 

dk' 

CO 

•!D 

CO 

cz* 

CO 

•ZD 

■:o 

<5 

05 

CD 

CO 

CE* 


CD 

CO 

•7S* 

ro 


o 

LD 

ID 

X 

X 

CD 

CD 

rH 

tH 

C'-J 

r-.i 

r? 

ret 


’T 

m 

O' 8 ' 

X« 

X 

r- 

r- 

CO 

to 

■T, 

CT. 

•X 

X 

a 

UJ 

IU 

LU 

UJ 

UJ 

X 

Ll. 

U- 

X 

X 

Lu 

X 

X 

X 

Lu 

ul 

Ll 

Lu 

'X 

u. 

Ll. 

u. 

u. 

U- 

u. 

Ll. 

X 

X 

P*» 

f'X. 

P‘- 


P-- 

r*- 

r- 

r-- 

r-'- 

r- 

; 

p-- 

p*- 

r-- 

r- 

r- 

X 

P*- 

r- 

r- 

r- 

r- 

r-- 

r- 

r- 

r. 

r- 

r- 


t 


C>! 

O 

CJ 

tH 


ID 

CS' 

UJ 

m 

p 

r- 

X 

lx 

X 


Xi 

r- 

Ci 

'•D 

X 

xH 

dj 

X 

X 

'X' 

CM 

CTi 

X 

di 

p 

n--, 

CTi 

X 

xH 

X 

dj 

X 

X 


IO 

•T. 


c-i 

rH 

ID 

X 

r-| 

'T 

r-s- 

iU* 

T—1 

r- 

X* 

0.1 

X 


r- 

X 

dj 

IX 

X 

c j rd 55 fx -h 

CJ 

05 

x» 

«7» 

tH 

rH 

r- 

tH 

Ll. 

•Ti 

CJ* 

•4.1 

CM 

r- 

F- 

CJ 

CJ 

LO 

Q 

p- 

CJ 

r- 

X 

a: 

rj 

cu 

CJ 

CD 

CS 1 

•X 1 

p- 

C3P 

UJ 

CJ 

•X* 

Q 

XI 

d5 

X* 

X 

X 

o 

•r-*j 

dj 

CTj 

X 

Lx X 

X 

CO 

rH 

X 

dj 

'•D 

•P. 

xH 

dj 

X 

xH 

iu 

xH 

d. 


*Jj 

•s* 

X 

m 

lO 

Xi 

CO 

ro 

X 

X* 

•'•■J 

r-"» 

Ul 

X 

X 

X 

X 

X 

X 

X 

X 

CTj 

L.t 

r- 

CC 

O 

X 

r- 

CJ 

* — 1 

OJ 

r- 

X 

dj 

r-- *25 

CM 

CM 

tH 

re* 

Cj 

TT 

'sO 

rH 

rx 

UP' 

xH 

CM 

tH 

CM 

xH 

i'j 

X 

•T-, 

•s* 

CD 

CJ 

r- 

CO 

r- 

CM 

CJ 

X 

r- 

CU 

r-- 

ro 

rH 

Ci 

rH 

X 

dj 

rd» 

X 

*25 

CM 

X 

CD 

•D 

Ul 


dj 

CJ 

CM 

da 

CD X 

X 

di 

dj 

cr* 

CO 

X 

rH 

da 

X 

X 

CD 

xH 

X 


d5 

xH 

CM 

CM 

05 

CJ 

aa 

o 

X 

•d* 

ro 

•T. 

CJ 

ro 

X 

CD 

X 

X 

X 

r•** 

r-'* 

r- 

o 

X 

X 

•dt 

r- 

CE* 

X 

r- 

rdt 

r- 

tH 

*:m 

r- 

cofi 

rx 

CJ 

tP 

o 

r- 

Tp 

xH 

r-- 

U*j 

r_J 

az 

XI 

ll 

X 

r-- 

X 

X 

X 

CJ 

X* 

X* 

CD 

ro 

ro 

CJ 

«!D 

IX 

CM 

r- 

X 

r- 

IX 

X 

CJ 

X 

ID 

ID 

dj 

*X 

CO 

CM 

X 


X 

Ll. 

X 

da 

da 

•d-t 

CM da 

da 

CO 

Tt* 

r- 

da 

xH 

da 

X 

X 

X 


•55 

ID 

X* 

Li 1 

Li.. 

X 


dj 

•55 

^p 

da 

X 


•dj 

ID 




X 

in 

Cli 

CM 

Ul 

CJ 

cr -1 

-P 

P*- 

O 

r- 

wJl 

cD 

•d 1 

Ll. 

r- 

•:-j 

rj 

r*- 

xH 

cm r - 

X 

dj 

PP 

re. 

■d' 

xH 

r- 

LO 

1 ^1 

r- 

•:*j 

r-- 

CM 

l*x 

up* 

•X 

i'- i 

X'* 


O 

•!D 

O 

IX 

X’ 1 

r- 

Ll 

ro 

CJ 

CM 

CM 

CM 

CD 

X 

r- 

r- 

.*, j 

LD 

l'M 

CO 

.-•5 

dj 


X 

Cli 

r- 


X 

•ro 

*d* 

x. CJ 


da 

?•• 

X 

da 

‘P* 

• M 

X 

X 


LT* 


da 


C^j 

cc* 

Cit* 

x-J 

cr. 

■p 



-p 

X 


X 


da 


X 

<o 

CM 

X 

OC* 

,• •, 

•dt 

It- 

c£ 

pp 

vj 

CJ 

rd 

wJ 

1 - 

iu 

d> 

r- 

*.M 

o 

r- x 

< J 

IX 

«d» 

r- 

X* 

rd 

X 

*-J 

IX 

xH 

X 

•d* 

P- 

X* 

X* 

X 

•:u 

o-. 

o 

x« 

s* 

.v* 

a> 

r- 

Cli 

r- 

r ‘i 

|X 

o 

fx 

X* 

X 

ro 

tH 

fO 

Tv- 

't 

cZj 
i •— 

8 

X 

X 

Q 

o 

r- 

IS 

fc' 

8 

X 

*:j 

8 

cr. 

XI 

da 

O 

X 

fx 

88 

da 

rx 

CJ 

Ll 

IX 

ret 

tH 

•5‘ 

8 

X 

CJ 

8 

re* 

tH 

8 

X 

da 

o 

c«i» 

Co 

da 

r_i 

uP* 

CM 

8 

CJ 

fx 

8 

8 

8 

ID 

'P 

CJ 

ro 

X 

8 

8 

|X 

•ID 

r^. 

LU 

8 

8 

xU 

CJ 

ro 

CD 

X 

r- 

CM 

X 

8 

X 

X 

8 

dj 

■’P 

dj 

r*- 

8 

X 

tH 

ro 

CJ 

X 

•X 

CJ 

cr, 

rd' 

t-*! 

LU 

8 

rd‘ 

r-~ 

888 

88 

X 

X 

8 

8 

8 

CO 

r-- 

ro 

tH 

dj 

CJ 

CM 

T-i 

X' 

X 

in 

Cu 

CM 

o 

in 

X 

8 

da 

>'-J 

X 

rx 

O'. 

'U 

CT, 

CJ 

Ch 

CJ 

in 

CD 

xH 

x-l 

X 

r-- 

ft 

LU 

X 

ro 

X 

-cH 

•X 

CJ 

CD 

8 

X 

rx 

UJ 
■ — 1 

cr 

ro 

X' 

IX 

CD 

o 

8 

X 

X 

«x« 

dj 

CD 

ip^i 

CJ 

LU 

8 

8 

8 

i — i 

X 

| 

CE« 

X 

X 

CM 

888 

X 

r- 

8ft 

tH 

T 

dj 

T' - - 

re« 

rH 

8 

r ■— 
»n 

CO 

pp 

ro 

rj 

ft 

o 

CM 

CTi 

ID 

•vD 

N 

eft 

8 

8 

8 

3 

8 

d> 

r- 

*D0 

ro 

ft 

8 

E 

dj 

xH 

CD 

8 

X 

rx 

o 

CM 

X 

r-- 

ro 

o 

X 

tH 

X 

tH 

CO 

rs» 

CO 

CD 

05 

l*\» 

C»5 

CD 

or* 

•25 

CO 

•?»' 

CO 

CD 

CO 3* 


«s» 

X 

•3» 

CO 

CD 

CO 

CD 

•:o 

^7* 

•:o 

•s* 

05 

•35 

•X 

CD 

05 

•35 

05 

aw 

‘rt 1 

05 

X* 

w 

r«5 

CO 

r»5 

CO 

•25 

05 

•25 

CO 

*25 

05 

ro 

(Tl 

Ch 

X 

az 

I'Ll 

lJ 

r j 

r, 

a, 

p 

UJ 

U.I 

X 

u_ CD 

a 

vi 

rH 

'■M 

CM 

r--» 

ro 

PP 

X- 

U~* 

to 

' L* 

*sD 

!'*- 


05 

CO 

Ch 

•Ti 

X X 

OJ 

CO 

|- ‘i 

i J 

dj 

CJ 

UJ 

LU 

LL 

X 

X* 

•S 

tH 

rH 


r, t 

j 

r 

CJ 

CJ 

O 

r i 

CJ 

CJ 

r .j 

r j 

l_J 

CJ 

uo 

o 

o 

dj 

dj 

dj 

Cl 

Ch 

dj 

dj 

dj 

•~J 

X 

di 

X 

dj 

X 

o 

Ci 

c 

CJ 

dj 

X 

dj 

id. 

•dj 

LJ 

dj 

dj 

dj 

id 

CD 

UJ 

UJ 

UJ 

UJ 

r._ 

P-- 

r- 

r- 

r*- 

r*- 

f's- 

r- 

r*- 

r-- 

r<- 

r- 

r-- 

r- 

r- r-- 

r-- 

r. 

r- 

r- 

r- 

r- 

r-- 

r- 

r- 

p- 

p- 

Ps_ 

rx 

fv. 

p- 

fx 

r*— 

r*- 

r-- 

r-- 

r- 

r- 

p- 

p-- 

P-- 

r-~ 

r- 

r- 

p- 

P-. 

P- 

p- 

r- 

r- 

r-- 



X 

r- 

CJ 

X 

rH 

CD 

ft 

ft 

S 

X* 

rri 

di 

X 

X 

r- 

X 

X 

rH 

tH 

8 

8^ 

CM 

CJ 


ro 

rH 

CD 

CJ 

CM 

Cl 

X* 


Cpj 

X 

CO 

rH 

in 

X 

DJ 


CD 


OJ 

X 

CD 

CJ 

•25 

X* 

X« 

ro 

rx 

u. 

u. 

TP 

ro 


C-.J 

•35 

ro 

o 

CM 

r- 

rH 

•45 

CE. 

<Xi 

o 

CO 

II, 

rH 

in 


ro 

05 

CD 

CJ 

ro 

CO 

•2D 

ai 

i j 

r- 

X 

r- 

X 

rH 

X 


X 

r-'t 

da 

X 

X 

X 

X 

•Pa 

Tt' 

•;r: 

da 

da 

X 

05 



rx 

•S* 

rj 

rx 

•!D 

X 

•2D 

‘vO 

•2j 

re* 

o 

X 

ro 

r- 

lL 



da 

X 


CD 

rH 

ro 

rH 

CM 

CM 

LO 

da 

ft5 

da 

CC* 


X 

o 

r- 

X 

X 

ro 

X 

rH 

rH 

CJ 

Cli 

X' 

r- 

X 

1 


CM 

r- 


da 

Ch 

X* 

k*- 

UPt 

CO 

da 

Ch 

CJ 

nr. 




ro 

LU 

O'. 

o 

CO 

rx 


X 

pp 


CO 

•S* 

on 

•dt 

X 

rH 

X 

CD 

u. 


X 

X 

a-. 

X 

•dr 

rH 

Tp 

rH 

CM 

CM 

'sO 

dj 

X 

p<i 

u. 

CJ 

p- 

CM 

tH 

r.i 


tH 

X* 

rH 

H 

CJ 

CP. 

CJ 

‘S' 

•S' 

X 

ro 

rH 

ro 

X 

r- 

^888^18 

LU 

C 

X 

TP 

8 

cr. 

X 



■"D 

05 

CD 

05 

CD 

CO 

<25 

■--•j 

CD 

05 

X* 

05 

X 

00 

X 


X 

CD 

rH 

rH 

r'-j 

CM 

ro 

ro 

rP 

Tp 

•jpt 

in 

'•iD 

'45 

r-~ 


CD 

CD 

CD 

CD 

CD 

CD 

CD 

CD 

X 

CD 

CD 

X 

X 

05 

CD 

A 

p- 


rx 

r- 

P-- 

P-- 

r- 

P- 

rx 

P-- 

P- 

r- 

! - 

IX 

1^- 


$88 

X 

05 

8 

8 

CJ 

CJ 

dj 

CJ 

X 

IX 

8 

dj 

CJ 

7B 

X 

rH 

8 

<o 

CD 

X 

tH 

8 

CTi 

DO 

LD 

r- 

'45 

'45 

X 

CD 

CM 

X 

X 

•o 

X 

CD 

rH 

rji 

CO 

XIX 

tH 

TP 

CM 

Ch 

IX 

dj 

CM 

P-- 

X 

LU 

Tp 

CD 

rH 

rj 

rH 

CM CM 

X 

X 

da 

O'. 

•01 

di 

X 

dj 

dj 

CJ 

U. 

rH 

X 

Ch 

rH 

HO 

ro 

tH 

o 

•D 

Oi 

CJ 

p- 

X 

o 

I s - 

rH 

tH 

IX 

X 

in 

COda 

r- 

•45 

X 

rH 

CM 

Ll 

X 

CM 

X 

X* 

*45 

X 

X 

CD 

X 

"■r ro 

TP 

X 

TP 

tH 

o 

r- 

dj 

CM 

r- 

ro 

X 

r- 

da 

LO 

Ur 


r- 

o 

X 

m 

UP* 

r— 

•^ 

X 



.* • 


CM 

•x> 

X' 

rH X 

X 

r- 

rH 

Ci 

rH 

X 

o 

t- 

X 

X* 

r- 

DJ 

CJ 

r- 

X 

CD^I 

lL 

CJ 

X 

X 

-H 

CM 

u- 

X 

CM 

CJ 

X* 

C£ 

X 


."•'.I 

P-U. 

IX 

1-0 

X 

rd 

dj 

fM 

rx 

X 

CM 

IX 

ro 

Ct 

p- 

x« 

X 

rx 

dt CO 
xrx 

to 8 

o 

r- 

cr. 

0-1 

CO 

rx 

X 

rx 

a, 

CD 

8 

8 

s 

8 

CJ 

r-- 

re* 

rH 

da 

CJ 

X' 

88 

8ft 

CJ 

re« 

2 

82ft 

X 

r-- 

LJ 

8 

IX 

TP 

X 

CM 

8ft 

05 

•S' O? 

CD 

05 

X 

•55 

X 

CO 

5 s 

X 

X 

05 

CD 

CO 

CD 

X 

rx 

CO CO 

ch 

Ch 

X 

X 

CO 

CO 

o 

CJ 

X 

dj 

X 

X 

X 

X 

Cli 

UJOJ 

UJ 

CD 

CD 

CD 

CC .i 

CD 

X 

CD 

X 

X 

CD 

CD 

CD 

CD 

p- 

r-r- 

r- 

P-- 

r-- 

r- 

r-- 

r- 

pv. 

N 

p- 

!X 

rx 


P-- 

p- 


fj 

X CM 

CO 

X 

X 

CJ 


r- 

r- 

r- 

in 

CJ 

S' 

CJt 

X 

!t2 

r- 

Ll CJ 

r- 

O 

X 

rH 

CM 

<25 

rH 

rH 

TP 

fx 

© 

CJ 

X 

CC 

rj 

azco 

da 

CO 

IX 

X 

in 

r- 

X 

X 

CM 

CJ 

tH 

-x 

c2a 

CJ 

ro 

da r- 

X 

IX 

ro 

da 

X 

■25 

r- 

r- 

CJ 

X 

r-j 


r- 

CJ 

o 

coco 

CJ 

0 s . 

o 

0*1 

in 

r- 

dj 

CJ 

un 

dj 

d. 

LU 

•r-j 

Tp 

CJ 

IX rH 

CJ 

CJ 

rH 

fX 

da 

•25 

CM 

OJ 

© 

CJ 

TP 

X 

X 

un 

r- 

X da 

X 

X 

Ul 

05 

in 

X 

da 

r- 

r- 

Oi 

TP 

rH 

o 

X 

Tp 

CM CJ 

Tp 

rx 

CO 

X 

CJ 

rx 

CM 

r- 

r- 

CJ 

Tp 

X 

CJ 

Li¬ 

X 

da ‘35 

X 

*n 

CO 


ch 

05 da 

IX 

IX 

rH 

X 

•:o 

UP* 

da 

rH 

o*S 

Tp 

X 

r- 

ro 

CJ 

CD CM 

rH 

rH 

i* *i 

r- 

rx 

un 

iX 

X' 

X X 

rH 

CM 

cc» 

TP 

IL 

X 

iX 

X 

X 

xH 

U - ' 

-j 

X 

OP 

X 

Tp© 

rH 

CM 

X 

S' 

ro 

o 

rH 

r- 

r- 

dj 

X 

© 

Li¬ 

Lh 

£J 

X rH 

X 

CT. 

r-- 

X 

•25 

Ll 

IX 

CJ 

•d' 

r-j 

az 

da 

da 

CJ 

«. 

• •- 

tH -*h 

r -~ 

X 

PO 

dj 

X 

r- 

rH 

nj 

<fM 

X 

c-o 

CJ 

r-^ 

ij 

X* 

XX 

X 

CD 

TP 

CTi 

IX 

H 

X 

r- 

r- 

•'—!• 

UP' 

© 

© 

•5*1 

ro 

UJN 

X 

X 

s> 

r-- 

I'O 

X 

•r 

p'- 

K. 

r- 

X 

i-*Pi 

a: 

Lpt 

8 

CO CD 
QrH 

CO 

rH 

X 

CM 

8 

X 

ro 

CO 

ro 

? 

X 

Tp 

ft 

CO 

UP' 

•25 

X 

CO 

X 

•25 

r 

CO 

rx 

© 

co 

CJ 

O CJ 

r i 

i* j 

o 

CJ 

CJ 

(j 

CJ 

CJ 

CJ 

CJ 

C j 

CJ 

tj 

o 

r- 

r-r- 

Id 

IX 

r- 

IX 

r-- 

r-« 

IX 

rx 

rx 

Px 

r- 

rx 

r-- 

r-. 


Number 22 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 41 


97 





Z-80 RAM TESTER 


Dear Dr. Dobb’s: Received: 77 Dec 7 

In the August issue of DDJ you carried an article by Jim 
Butterfield which listed a RAM test program for the 6502. 
This article in turn referenced an algorithm described by 
Knaizuk and Hartmann in the IEEE Transactions on Compu¬ 
ters (April 1977). Enclosed for your perusal is an assembly list¬ 
ing for the Z-80 version of this program. Some frills have been 
added for those lucky people who have the TDL “ZAPPLE” 
Monitor. These allow the user to specify the start and stop 
addresses and print out the location of the error byte. 

I have found this test program to be exceptionally good as 
well as fast. It even found a pattern sensitive 2102 that I had 
saved for the occasion from a previous hair tearing session. 
Keep up the good work! 


John MacDougall 


110 North Gordon Way 
Los Altos CA 94022 





o 

+ 








a 



X 

Q 


z 



•H 

tq 







c 

X 



a 

H 


>4 

H 

i j 


>4 

a 

u 


o 

X 










o 

a 



tH 

z: 


X 

X 

a 


X 

t—* 

< 


£ 

o 


C 

X 






a 


a 

c? 


>4 

a 


O 

a 

z 


o 

c/J 




o 

a 

CO 

o 




a 

a 

H 

43 

<c 

z 


a 

?: 


j: 

z 



£ 

1—1 

H 


z 

<c 

tH 

C) 

z 




o 

(H 

>4 

ttl 


H 



a 


a 




a 

r-5 

Z 


H 

£ 

>4 

X 

1—1 




a 

>4 

a 


X 

H 


X 

a 


£ 


rH 

a 

£ 

a 

H 




a 


£ 

X 



a 

a 


to 

o 

CO 


o 

X 



X 


tH 


X 

X 


z 

z 


H) 


o 



o 


X 

c 

M 

a 


-3 

£ 


X 

o 

X 

>4 

X 


X 


CJ 

O 

X 


X 

a 

X 


a 

X 

o 

o 

c/J 

C—< 



o 


tH 

X 

X 

a 

IH 

C3 



a 


o 

tH 

o 


a 


z 

o 


•«H 

V 



£ 

o 


rH 


a 


rH 

a 

o 


a 

o 

z 

X 



o 


a 

O 

rH 

43 

H 

X 





< 

F—4 


X 

-£ 


tH 

a 

L3 

z 

IH 

*=c 

z 


<=c 



<c 

£ 

m 

X 

CJ 


a 

a 



z 

H 

o 


a 



a 

rH 

£ 

H 

c/> 

r 



X 

£ 


o 


X 


o 

o 


r d 

a 

z 


d 

a 

X 

X 

z 

O 


c/J 

o 


Q 


a 


a 

o 

H 



a 

a 

<C 

X 

O 

rH 

<c 

X 

IH 

o 

a 

a 

O 

o 

\ 

X 

t—< 

Z 

z 

t—• 


a 

rH 

C/J 

H 


a 

a 

a 


o 

X 

£ 



tH 




H 

X 


c/J 

a 

X 

rH 

X 

H 



a 


o 

o 

X 

X 


X 


X 

a 

rH 

c) 

a 

X 


C ) 

Q 




z: 

a 


(D 

tH 

<£ 

c- 



£ 

£ 

tH 


X 

£ 

> 

z 

o 

a 

d 

.s 

H 

< 

IH 

H 

H 

o 

a 

o 

a 

a 

a 

O 

o 

o 

C3 

O 

a 

o 

o 

o 

=c 

(J 

a 

< 

•a 

O 

C/J 

o 

a 

a 

a 

£ 

a 

o 

a 

o 

X 

II 

H 

H 

u 

o 

•VJ 

tH 

X 

o 

a 

£ 

X 

o 


Z 

a 

a 

o 

o 

X 


'O OBJ) O 

in a z: =c < z. o 

X H H O H - O tH - 

o a £ (D C/J a O £ < 


: c a 

. -H J S> i 

: -*-> <c o 
> 3 o s 
o 
g 


T3 

O *“ Q o m H 
on c* vOOOOQre 

O O =T lA Z z H Q < J 

~ x - x x h h <d o ih z 

2 ifljj<i;aojQos 2 : l a, to d 


x x J ni a: o Q 

a) < a j h 

£:>£0 £ozo< , -3 £ c o a a a 

0£T£01 l Ua < 'jQ h J'HJJJ Z 

43 

3 •• 

•• O O 

Q G H 

O -O OQ Q 

Z 3 < Z 

»-« X •/) H d 

£ a • - co 


O O t- m C\l X X q 

O O O O X a 

3 C- d O CT> X d vO O out] ? <- o o o 

J 4 in (\1 b CM lQ o «- C- q O O 0 CJ 


- - 

Q J O 
CM (M O 
O O 
O O q 
lO 

=t, C 3 ON 

on c\j -d CJ 


•o 'fl q x cm in >n c- o <x o a x o «— in o < o x cm .o 

in in in in in in in in n n -o o ~o o 0.0 o h e b 

ooo oooooo ooooooooooo oooo 

ooo ooooooooooooooooo oooo 


C *H b0 
0) L C 
-*-> 3 -H 


< 4-3 0) 

: w c to 

> tD o c - 

4-3 (DO) 

■» "O CD C 

. (D (D £2 o 

) G a 

• H Cm (D Ci_i 

> -H > O 

-C C0 

. * CO £ to 

I 4-3 (D 

^ c to H 

I 3 - CO 
W to O S- 

> a> o -h 

1 G Ou 4-3 <D 

. „ cd -C 

0 Cl) to o 4-3 

-G » O 
4-3 O rH 
O <D 
bO rH E 
G <D rH -H 

£ n) *3 
4-3 

o rH to 
CD -G -H *H 

■C D D £ 

O -H C ^ 

5 3 

TO 4J 

C t) jj <a! 
fti CD 

43 (U 

c (fl . 
O CD t3 
•H Q. (D CD 
" c t, 

B k D II) 
O > 

O CO o o 

I -H 4_3 o 


: x a o 
o o h * 

1 OJ B M 

> b0 * 

, L 3cc 

> o O o 

> o 

to (0 H 

it) £ td 

c c 00 
. o c .« 
i o c 
J CD O 

< to 3 

> O I CM 
I CM I O 


OH a 
H X Q 
<C O 

O H Z ZJ 

O '/> M - 

X r x- 

x a a x 
x x 

-2000 

O H t-* 5 i 

2 to to H 


o ^ o x 
Muza- 

X O H C*» 

J 2 Q 
O 33 z i 
x q =c 
h 2 H a 

x! d H H I 

X S ^ i—4 *3) «aj 

O 

2 r i< (b Z a] J 

i- Ct, o x a. 

H D Jd d 2 

a H H t I O 

CO !0 9) O Z O 


H Q O M 

h d d 2 ;* 

X (H E 2 

>4 CO O ^ CO 

O CD H H O CO 

a z a 

z h ^ x 

^ - Cx, U 'd C 

O CO <C z H O 
Z O d S O X 'H 
O- X .£ x3 4-3 

O - • Cd Z (0 

X CO H xj CO > O 

d d d X d O O O 

N>hO<^2HH 


G X X d 

O =Z O 3 

ClHZ Z ' 

•H CO M c- a ■ 

E £ a H < 


X H x 

xx cm a x 
x- <£ a o a o 

X H Z * O - 
O CO -d C X <£ 


a a a 

a a X I—I =£ ,_! 

-t: c a h 

-> co CO £ CO £ 


XXX 
X X o 
< a a a o 

o co co o 


a a a 
=» a a a > 

o =c < o 

s o o o s . 


a o h x 

a o x 

o o o x a to 

< o x o o <* z 


x c 

<Z OJ < rH X X CD 

x x a x a o £ a 

Oaaooaaa 


Cm o Cm o 

X H «“ Q_ JH 

3 co a H 3 cO 

4JctoifiH iJcj;< ao 

w ^ ^ i 2 n ^ «oa - 

co £ o a to u o z < 

CD (D 

5 C 

•H .H 

43 43 

2-3 -3 2 s 3 a a 

P oa>a.z>. 

G<£0<££ o X X o 
ao£oa 0 o£oa£i 

3 3 


I H CD lQ CO X •• 

: X X .. x *H X H 

i <c a a a c a a 

I H q 5 iO E-« H O 

■ co • a • • - a a 


o 

- m . - * 

^ ^ 2 ° cm a x ao 

X CM O CM mm 4- (MO 

a-o o ooo oo 

(MXOi^nCMOX ooo •— o O X *- 

o in o x x o a 

a a cm a d cm a x 3'3aoixt^ o cd <c a x) 

o a cm dmmm.=j-c_>ooc'tMcQCMonxocn«— 

22^22- d ’“° ri ^‘ c ' <c 3 d X O CM 111 E <C a 
x2222 0r_,— ,-r " r-r-r ' r_( A J CMCM<MC\JCM 

22222°°°oooooooooooo 

OOOOOOOOOOOOOOOOOOOO 


O X 

X 

a «- a o 

o ^ o •- 


O O ifl OO 

o o o 

Q t*- -a o 3> x H o 

O 4- X CM b CM b O 


a a a a o o 

CM CM CM CM m m 
oooooo 
oooooo 


cm in so 
mmmm 
oooo 
oooo 


a a x «- m =t in o 
mmmd-^ d- a a 
oooooooo 
oooooooo 


Page 42 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 22 


98 










MINI-EDITOR FOR 8080 PILOT 


O 

-O 

O 

O 


Cx3 D 
m C\J 
O O 
O O 


<X 

•il 


Q 

o 

Z 

r-i 

s 


E-* 

cc 

<c 

H 

CO 


O t* 
cn LH 

g O 
O o 


o o 
o o 


o 



*2 r-t 


H 


IO X) J (\| 
f'o o m 
o o o o 
o o o o 


f H Cl. 
^ -J O 
OH dh 
Q C -s co 


o 

J3 

£ 


O O o o 
o o o o 


o 

QC H 
O CO 

_ -z < 

O M fcH 
S (O 


il, Cl, a. 


I 

b0 

C 


X 

<D 


Q C- Ci, i] a Cd C 

(\J CQ Cl, Cl, O CQ CM 

C\l Cl, Cl, C *-of Ox O 
m (\J Cl 4- Cl, E O 

c\j o' ci, o co cu a 

O t- Cl. O r- O CM 

a o *- u cq jo <c 

on o a vO i. *- m 

O Cl. jo ca o m a 

o «- o «- o a 

O Q Q < in vO oo 

mumcL.CL.O'- 

onoox>*-a^r 

in O Cl. «- vO CX 3 Cl, 

Q a O in Q Cl, o 

amoaocM*- 

o q < »- m oun 
O O O VO O ^ r x. 

a o o .a so c- *- o> 

(MOODOO-OO 

CMCMa«-C^OQO 
iM m i, ^ C- CM O O 

^■Qooao«—o 
(aooocMOOon 

r i, C*. Q u O' a ^ CQ 

a a- cm n c- ci. Cl, in 

Q Cl, < Q in C' OQ 

c_> cl, on o o a- t- a 

CM a •- Cl, O O a- O 

O on Cl, x. rvj o o o 

aojoaooma 

OOCMiOOUCM 


o 

o 

o 

o 


o 

o 

o 


o o o o o 
cm on =r m o 
o o o o o 
o o o o o 


Tim Scully is a friend and business associate who is an 
inmate at a Federal penitentiary. Despite that, he’s busier and 
more productive than most prople I know. Tim has been 
designing biofeedback equipment and doing biofeedback 
research for many years. He is now working on a doctorate in 
psychology; his dissertation project involves researching and 
developing bio feedback systems and techniques for use in drug 
rehabilitation. He is also publishing articles on biofeedback 
and microcomputers in People’s Computers and, as you see 
here, writing articles in other areas as well. 

With permission from prison officials, Tim has begun devel¬ 
oping a microcomputer-based system which will allow a 
cerebral palsy patient to communicate. A knee switch on the 
wheel-chair system will enable the patient to construct 
messages which will be displayed on a CR T. He plans to make 
his work available to the public. 

In addition, Tim is teaching a computer class to fellow 
inmates, using the computer system belonging to the cerebral 
palsy patient. Tim is hopeful of eventually obtaining a 
computer system for the prison, despite the fact that prison 
resources are scarce and he cannot solicit donations. But 
while donations can’t be solicited they can be accepted so long 
as no strings are attached. Contact me for more information 
if you have equipment to donate to Tim. 

Phyllis Cole 

Editor, People’s Computers 

Box E 

Menlo Park, CA 94025 

Tim Scully Received: 77 Oct 23 

I have a Poly System 4 with 8K of RAM (from 2000H— 
3FFFH). A few weeks ago I decided to get PILOT running 
on this system, and translated Dr. John A. Starkweather’s 
8080 PILOT 1.1 (from May 1977 Dr. Dobb’s) so that it would 
live comfortably in Poly’s memory, starting at 2000H. After 
writing a few simple PILOT programs, the need for an editor 
was clear. Being short on memory, I didn’t have room for an 
elaborate editor program, I wanted to squeeze a mini-editor 
into the space between a jump to the start of PILOT at 2000H 
and the actual start of PILOT at 2100H. 

The program listed below was hand assembled because Poly 
has neither an assembler nor a printer. The program uses 
several subroutines from the Polymorphics 4.0 monitor ROM, 
and these are the only labeled calls in the program listing. If 
you have another hardware configuration, you will want to 
replace these calls with some of your own. Here’s a brief 
description of what each one does, in case you don’t have the 
Poly monitor. 

WHO — fetches a character from the keyboard and returns 
it in A. 

WH1 — prints the character in A on the TV screen, recog¬ 
nizes a carriage return as carriage retum/line feed, recognizes 
CTL Z as a jump to monitor command (so I modified PILOT 
to use CTL B where Dr. Starkweather used CTL Z), and recog¬ 
nize CTL L as a command to erase a line (so I modified PILOT 
to use CTL L where Dr. Starkweather used CTL U). 

DEOUT — prints the contents of DE as a four digit hex 
number. 

MOVE — moves — BC bytes from an area starting at (HL) 
to the area starting at (DE) . . . only useful for moving from 
higher addresses to lower addresses. 

The mini-editor displays one line of your PILOT program at 
a time, beginning with the first line. At the beginning of each 
line it displays the memory address (in hex) of the first char¬ 
acter in the line (you can easily delete this feature if you don’t 
need it). The mini-editor is designed to drive a video display, 


Number 22 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 43 


99 


3-WAY BASIC MARRIAGE 


Received: 77 Nov 18 

I have been most pleasantly surprised by DDJCC&O after 
many rip offs and disappointments (i.e. Logic Press). I would 
gladly pay twice your subscription rates. You are truly doing 
an outstanding job of providing a needed service for the 
private computer user. 

I have adapted the LLL BASIC which was printed in 
DDJCC&O for my home made 8080 system and of course 
the first thing off I want more goodies. It seems to me that 
the Extended Accuracy Arithmetic package by Dinely in 
Vol. 2 No. 3 of DDJCC&O would be a useful addition to 
the BASIC interpreter. If there is any one else of like mind, 
I’d appreciate the chance to correspond with them. Another 
major feature which I am now adapting for my system is 
Dr. Starkweather’s 8080 PILOT. I plan to combine the LLL 
BASIC with PILOT using the source line editor in LLL BASIC 
to edit PILOT statements. Dr. Starkweather’s 8080 code 
for PILOT is beautifullly organized and commented and his 
“Guide to Pilot 8080” is also an exemplary job. 

If you are interested, I can send a souce listing of my 
results of the marriage of those 3 contributions from 
DDJCC&O. 

Yours Truly, 

B. Reeves 2-18 Patpong Road 

Bangkok 5 
Thailand 

Many thanks for the compliments! And yes indeed to that 
offer. We’d be most pleased... sounds like a “marriage made 
in Heaven ”-TR W 


but could easily work with a printer if you don’t mind using 
up some paper. 

Because of the small memory space available in my system 
for this editor, it does not use a cursor to indicate where 
insertions or deletions are to be made. Instead, if insertion is 
requested, a character will be inserted just before the first 
character presently being displayed. If deletion (rubout) is 
requested, the first character on the display will be deleted. 
The spacing feature of the program allows part of a line to be 
displayed so that insertions and deletions can be made in the 
middle of a line. When first called, the editor will display the 
first line of your program. The editor commands are listed 
below. 

Carriage return — displays the next line 

Line feed — backs up the display the previous line if you 
are looking at a complete line. If you are looking at part of 
a line, it backs you up to the beginning and shows you all of 
it (useful for seeing the results of insertions/deletions). 

Space — skips the first character of the previously displayed 
line and displays the remainder of the line, useful for editing 
in the middle of a line. 

CTL B — returns to PILOT if you called the mini-editor 
from PILOT. 

CTL D — inserts a space just in front of the first character 
on the display. 

CTL E — inserts a carriage return just in front of the first 
character presently on display. 

Any other control code - will be ignored (except CTL Z 
if you are using the Poly monitor ROM). 

Any other non-control character — will be inserted just in 
front of the first character presently on display. 

RUBOUT — deletes the first character on display. 


203E 

23 

I NX H 

move ahead one character 

203F 

C31820 

JMP 2018H 

display the remaining line 

20b 2 

FE7F 

CPI 7FH 

check for 'rubout' 

20bb 

C26220 

JNZ 2062H 

if not rubout, keep looking 

20h7 

2ao:-:20 

LHLD 200EH 

fetch starting address 

20b A 

E5 

PUSH H 

copy HL 

20b B 

D1 

POP D 

into DE 

20b C 

010000 

LXI B,0 

initialize PC for use as counter 

20b? 

3501 

KVI A,1 

set up to check for end-of-program flag 

2051 

2B 

BCX H 


2052 

23 

I NX H 


2053 

OB 

DCX B 

count one character 

205b 

BE 

CMP M 

check for end flag 

2055 

C25220 

JNZ 2052H 

if not end, keep counting 

2056 

2A0E20 

LHLD 200EH 

fetch starting address 

205B 

23 

I NX H 

skip the character to be rubbed out 

205c 

CD0001 

CALL MOVE 

move the rest of the program dov.n one byte 

205F 

031*20 

JKP 201BH 

display remainder of line (after rubout) 

2062 

FEOD 

CPI ODH 

check for carriage return 

206b 

CA1620 

JZ 2018H 

carriage return displays next line 

2067 

FEOA 

CPI OAH 

check for line feed 

2069 

C27*20 

JNZ 207BH 

if not, keep looking 

206C 

2AOE20 

LHLD 200EH 

fetch start of line 

206F 

2B 

DCX H 

line feed '-acks up a line 

2070 

2B 

DCX H 

back up 

2071 

7E 

MOV A,M 

fetch character 

2072 

FEOD 

CPI ODH 

look for carriage return 

207b 

C27020 

JNZ 2070H 

and keep hacking up until you find one 

2077 

23 

I NX H 

move ahead to start of line 

2078 

C31820 

JKP 2018H 

and display it 

207P 

FE02 

CPI 2 

look for (TIL B 

207D 

C8 

RZ 

CTL B returns us to PILOT 

2075 

FEOb 

CPI u 

check for CTL D 

2060 

CAB320 

JZ 20B3H 

CTL D inserts a space 

2083 

FE05 

CPI 5 

check for CTL E 

2085 

CAP620 

JZ 20E&H 

CTL E inserts a carriage return 

2086 

FE1F 

CPI 1FH 

skip any other control codes 

208 A 

DA 33 20 

JC 2033H 

bv fetching another keypress 

208D 

2A0E20 

IH ID 200EH 

fetch starting address 

2090 

F5 

PUSH PSW 

otherwise, save character so we can insert 

2091 

3501 

KVI A,1 

set up to look for end-of-program flag 

2093 

010000 

LXI B,0 

initialize 3C for use as counter 

2096 

2B 

DCX H 


2097 

23 

I NX H 


2096 

OB 

DCX B 

count one character 

2099 

PE 

CMP K 

check for end flag 

209A 

C29720 

JNZ 2097H 

if not end, keep counting 

209D 

5b 

MOV D,H 


209E 

5D 

MOV E,L 

copy HL into LE 

209F 

13 

I NX D 

move program 

20A0 

7E 

MOV A,M 

up one character 

20A1 

12 

STAX D 

; to make room for 

20A2 

IB 

DCX D 

; insertion 

20A3 

2P 

DCX H 

; 

20Ab 

OC 

TNR C 

; count one character 

20 A 5 

C29D20 

JNZ 209DH 

;keep on if not last character 

20A8 

ob 

I'JR B 

20A9 

C29D20 

JNZ 209DH 


20AC 

FI 

POP PSV 

;fetch back the character 

20AD 

12 

STAX D 

;and insert it 

20AS 

23 

I NX H 


2 OAF 

23 

I NX H 

space ahead 

20B0 

C31&20 

JKP 2016H 

;and display the remaining line 

20B3 

3520 

MVI A,' ' 

;insert space 

20B5 

C36D20 

JMP 208DH 


20R8 

3E0D 

MVI A,ODH 

;insert carriage return 

20HA 

C3&D20 

JMP 206DH 





listing for 

mini-editor 

2010 

210030 

LXI H,3000H 

start of program storage 

2013 

3'EOC 

MVT A,0CH 


2015 

CD2bOC 

CALL VJH1 

clear TV screen 

2016 

220E20 

SHLD 200EH 

store starting address 

201P 

2 tr )E20 

LHLD 200EH 

fetch starting address 

201E 

E? 

XCHG 

move address to DE 

201F 

CDD103 

CALL DEO’JT 

print DE as b hex digits 

2022 

E? 

XCHG 

restore address to HL 

2023 

3520 

MVI A,' • 


2025 

CD2b0C 

CALL Vfril 

print a space 

2028 

7E 

MOV A ,M 

fetch character from memory 

2029 

CD2b0r 

CALL VJH1 

print it 

202C 

72 

MOV A,M 

fetch it again 

202D 

23 

I NX H 

set up for next character 

202E 

FEOD 

CPI ODH 

check for carriage return = end of line 

2030 

C22820 

JNZ 2026H 

if not end of line, print more 

2033 

CD?' V )C 

CALL WHO 

fetch keyboard input 

2036 

} 520 

CPI ' ' 

check for space 

2036 

02b220 

JNZ 20b2H 

if not, keep looking 

203P 

2■0S20 

IP!LL 200EH 

fetch starting address 


Page 44 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 22 


100 






THE LAST REHASH OF BEAU HEX? 

Some letters on the subject 

Dear Dr. Dobb: Received: 78 Jan 24 

I have been noticing for some time, a gradual trend toward 
pseudo-religious fanaticism in many phases of computer 
related activity. We are condemned to everlasting failure if we 
don’t organize our programs like bands of angels. Some other 
fate awaits if we don’t throw away our flowchart templates 
and take up weiner diagrams, whatever they are. 

Those of us who know from long experience, that older and 
other methods work well when employed by competent 
people, have tended to dismiss these cults as the products of 
people who sought to cure their basic inability to organize 
their work logically as they went along, and then found that 
they could make (lots of) money by selling their ideas to the 
ignorant. We recognized them as rather childish simplifica¬ 
tions of the situation, shrugged our shoulders and went on 
about our business. 

The letter from Mark J. Nitzberg, in issue 2/9, reveals that 
this may have been a mistake. We have a young person of 
unknown experience level, who raves over the virtues of 
hexidecimal notation, and condemns octal, both with religious 
fervor, and with arguments which have nothing to do with the 
problem at hand. 

I think his letter has gotten me in a violent enough mood to 
respond in kind, and I have prepared a counter argument in 
the form of an open letter to Mark: 

James C. Matthews 

Dear Mark, 

I read your letter endorsing the use of hex. It seems that 
you are quite comfortable with this notation. Probably you 
can even do hex arithmetic in your head. However, there are 
two errors in your assumption that we must all abandon octal 
or suffer some everlasting (but undefined) torment: 1. The 
fact that you find hex easy to work with does not mean that 
all of us are equally able to manipulate large-base numbers, 
and; 2. You don’t understand the purpose behind the intro¬ 
duction of either the octal or hex formats. I shall try to 
explain these points, along with some other areas about which 
you seem a little fuzzy. 

First off, storage space, and the waste or conservation 
thereof, has nothing to do with either form of notation. Very 
little, if any, data is ever stored in either. The beast can count 
neither to 8 nor to 16, but only to 2. Everything is stored and 
acted upon in binary. If we really wanted to save paper and 
keystrokes, the thing to do is develop a printable set of 256 
distinct characters. Then a simple 8-key pad would suffice 
for data entry. (Don’t laugh-many users of ARPANET’S 
DNLS have become surprisingly proficient at entering ASCII 
data with the mouse buttons and fingerboard. They use the 
normal keyboard for initial entry, but only for very long 
changes while editing.) Of course, we would need to memorize 
the entire set of 256 characters, and do the binary-to- 
octabinary (seems like a good name for our new notation, we 
can say OB for short) in our heads, but then that’s a small 
price to pay for all the paper we would save. 

Octal appeared very early on the computer scene. The 
human brain seems to have something against long strings of 
repetitive characters. Binary, having only 2 character variations, 
reaches the rejection point very quickly. The limit seems to 
be about 6 bits, because most people who work with Baudot 
teletype soon learn to read the 5-unit code from punched 
tape, but very few ever learn more than a few characters of 
7-unit ASCII. (I do know this may seem to go against what I 
said about the DNLS users, but in that case it is broken into 
a 4-unit string for the left hand and a 3-unit for the right.) 


In any event, when memories were slow, and word lengths 
were growing by leaps and bounds to minimize the number of 
required accesses, people soon found that they could not deal 
effectively in the language the Machine was compelled to 
speak. People were used to dealing in decimal representation 
of numbers, and octal was the nearest subset of decimal that 
used an even binary set. Octal, therefore is purely a matter of 
convenience for the human in dealing with the blinkey beast. 

The development of hex is a compromise. Since most 
applications of computers require some nibbling at, if not 
actual crunching of decimal numbers, most machines become 
proficient, via hardware instructions, at either XS3 or BCD 
arithmetic. (You mention the 8080’s DAA as though it had 
something to do with hex. It doesn’t, it’s for BCD.) The 
great sages in their ivory towers, who spew forth nionitors and 
operating systems, discovered that ASCII is effectively a super¬ 
set of BCD, and they could save a few bytes of code in their 
creations by dragging the humans across the boundary of 
decimal to something easier to do on latter-day machines. 
And what it was, was hexidecimal. Hex was rather well 
accepted for several reasons: a. It came with the machine. If 
you wanted to talk to it, you learned hex. b. Doing arithmetic 
with alpha characters mixed freely with numbers enhances the 
mystique of the profession. While most octal users, in my 
experience, do simple arithmetic in their heads, most hex 
users seem to do their’s on paper. This is almost certain to 
awe the onlookers. 

You are totally wrong about any advantage of hex in mem¬ 
orizing the 8080 instruction set. In hex, there is no visible 
relationship of families of instructions, and you must 
memorize the entire set of over 200 instructions separately. In 
octal, the relationships are easily seen, and there are only 
about 20 basic instructions and variant rules to memorize. This 
is a clear 10-to-l advantage for octal in that most precious of 
all storage units, your one and only brain. 

You also seem to fail to understand the logic behind the 
“amazingly unorthodox” split octal representation used when 
8-bit machines have 16-bit addressing capability. This again is 
simply a concession to the human, allowing him to see the 
contents of each of the registers holding the 16-bit number, 
separately, as they really exist internally, and as they must be 
acted upon, in most cases. 

And finally, some philosophy. You did not have to compile 
that letter. Most people who become addicted to bit-flipping 
will be exposed to all manner of number representations, and 
hopefully, will be able to choose one that is right for them. I 
don’t have to write this, but I am a technical atheist, and take 
pleasure in espousing things looked down upon by those who 
allow some religious fervor to override their logic and 
condemn things without good reason. I don’t believe that any 
Supreme Being gives a hang how we structure our programs, 
draw our flowcharts, or represent our numbers. God, and the 
religious orders which help to channel some of our energies in 
search of truth and goodness, have far greater concerns in 
getting us to live with one and another, and with and upon this 
poor old Earth. You are wasting the energy and enthusiasm of 
your youth in pursuit of some rather nebulous dragons. Please 
try to find a channel that will have more lasting and meaning¬ 
ful results than trying to teach people to count on all 16 
fingers when they have only ten. 

Very sincerely, 2028 Merrily Dr. 

James C. Matthews Montgomery, AL 36111 

Dear Sir, Received: 78 Jan 16 

I am new to computing, so was unaware of the octal/hex 
controversy. Needless to say, I prefer octal, since there is less 
to leam. What hex proponent can state that hex never led him 
into error? (more) 


Number 22 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 45 


101 


SWTPC CT-1024 AUTOMATIC SCROLL 

Dear Mr. Warren, Received 77 Dec 12 

Having implemented the modifications suggested by Mr. R. 
Lynn Smith in the February 77 issue (pp. 25-27), I found it 
desirable to keep full control over the cursor (using the 
SWTPC Cursor Control board and Screen Read board) rather 
than have a cursor stuck at the last line of the screen. 

This can be achieved in a very simple fashion, as described 
next. The purpose is keeping all standard behaviour and all op¬ 
tions normally functioning, except when a line feed is issued 
with the cursor in the last line. In this case the text must be 
scrolled up, and the new line “cleared”. The solution given can 
be used independently of whether or not the 64 char/line 
option of Mr. Smith is implemented. It requires only 2 more 
IC’s: a 7420 quad NAND and a 74193 counter. 

The present situation (with or without 64 char/line) is 
shown in Fig. la, and the required modification in Fig. lb. 
When the cursor line counter (1C34) decimal value is 0-14, the 
behaviour is as if nothing had changed. When count 15 is 
reached, further “up” counting is inhibited. Instead, the next 
“count up” pulses increment the 74193 counter whose con¬ 
tents are added to the address portion A5-A8 (addressing the 
memory), thus causing scroll-up. This counter/adder configu¬ 
ration (74193 and 74283) can be built on a 1” by 2” PC card 
attached to the memory board, thus requiring only one “ex¬ 
ternal” connection. 

Software aspects. In order to maintain modularity and flex¬ 
ibility, a difference is made between “line feed” and “cursor 
down” when the cursor is in the last line. The first causes 
scroll-up, the second causes cursor wrap-around to the first 
line. Thus, programs that consider the CT-1024 as teletype re¬ 
placement always use “line feed”. Programs considering the 
complete screen field as basic output record format use all nor¬ 
mal cursor positioning commands (up, down, left, right) etc.. 
Note also that IC34 has still its preset capabilities available for 
those wishing to use direct cursor positioning. 

I hope that these suggestions will be helpful to some 
readers. 

Sincerely yours, 

R.T. Boute Francis Wellesplein 1 

Bell Telephone juClub B-2000 Anterwerpen (Belgium) 


4 MHZ Z-80 A BOARD BY NORTH STAR 

News Release Received: 77 Dec 20 

North Star Computers, Inc, announces a 4MHZ Z-80A 
processor board (ZPB) for use in S-100 bus computers. The 
Zilog Z-80 A executes compatible software more than twice as 
fast as the 8080. The North Star ZPB will operate in systems 
with or without front panels. It includes space for IK of 2708 
EPROM. 

Other features include auto-jump startup and vectored 
interrupts. Available as a kit for just $199 or $259 fully assem¬ 
bled. EPROM option costs are $49 for kit and $69 assembled. 
For additional information write: North Star Computers, Inc, 
2547 Ninth St, Berkeley, CA 94710, (415) 548-0858. 

Machines know nothing of the controversy; they work in 
binary. Octal and hex are merely convenient ways of restating 
binary for the sake of humans. A manufacturer wishing to 
please everyone, could issue two sets of manuals, one set in 
octal, and the other in hex. (Or could they?) 

The new fact seems important to me, that innovative manu¬ 
facturers aiming at mass markets (“home computing”) have 
stayed with octal. I mean Heath and Radio Shack. 

Yours &c;. &c., P.O. Box 1818 

Joe Schram Washington, DC 20013 


COMMUNICATIONS APPLICATION 
FOR THE HANDICAPPED 

Tim Scully, who has been designing biofeedback equipment 
and doing biofeedback research for years, is currently an inmate 
at a Federal penitentiary where he is working on his doctorate 
in psychology; his dissertation project involves researching 
and developing biofeedback systems and techniques for use 
in drug rehabilitation. 

With permission from prison officials, Tim has developed 
a Poly-88 based system which allows a cerebral palsy patient 
to communicate. A knee switch on the wheelchair enables the 
patient to construct messages which are displayed on a CRT. 
A complete description of the system including the assembly 
code listing has been published in Volme 6, No. 5 of People’s 
Computers (March/April issue). 

Tim is hopeful of eventually obtaining a computer system, 
despite the fact that prison resources are scarce and he cannot 
solicit donations. But while donations can’t be solicited , they 
can be accepted so long as no strings are attached. 

For further information contact: 

Phyllis Cole 

Editor, People’s Computers 

Box E 

Menlo Park, CA 94025 


Fin- 1» 

Present situation 


r 

1 cursor up * 





IC34 3 

4 2 

5 6 

7 


|(J3 pin 5) 

|count down 


| count up 



! line feed 



1 (IC30 pin 6) 

1 cursor down 

^ 1 


74193 


| (J3 pin 3) 

1 MAIN BOARD 

1 

J 



Page 46 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 22 


102 




















dr. dobbs journal of 

COMPUTER 
C 

Running Light Without Overbyte 

Number 23 _ March 1978 Volume 3, Issue 3 

A REFERENCE JOURNAL FOR USERS OF HOME COMPUTERS 


Status of the USCD PASCAL Project — Kenneth Bowles 

Report on efforts to implement PASCAL on various processors 

SAM 76 — Additional Comments — Ancelme Roichel 
Addenda to the documentation published by Dr. Dobb’s 

SOFTWARE 

For 6502’s 

Renumbering and Appending BASIC Programs on the Apple-II Computer — Steve Wozniak 
Apple’s R & D Head tells how 

A KIM Binary Calculator — John Eaton 

How to solve those problems you never had until you had a computer 
For 6800’s 

STRUBAL: A Structured BASIC Compiler — Robert Grappel 
For Z-80’s 

A Z-80 Tracer — Arthur W. Cline 
For 8080’s 

ACT — An 8080 Macroprocessor — Alex Cecil 
PL/M Listing with documentation 


alisthenics 


60 


rthodontia 


16 

46 

4 

13 

10 
11 

20 





© David Dameron 1979 


LEST WE FORGET.. . 

Technology often has a way of absorbing us in its intricacies 
to the extent that we can lose sight of the implications of what 
we are doing. It is for this reason that we have decided to 
interrupt our “bit fiddling" for a brief moment and refer to 
the ad which appears on the inside back cover of this issue. 

It is certainly not the policy of Dr. Dobb’s to preach on 
controversial issues. But we who are interested in reason and 
“artificial intelligence”-still an extension of human intelli¬ 
gence-should stop to consider that there exists on this planet 
another race of intelligent beings which is being systematically 
hunted to extinction. 

There are, of course, innumerable other causes we could 
choose to comment on, but the slaughter of whales has 
symbolic value. It asks a question of technological society 
that strikes at the relationship of technology and industry 
to intelligent life. We at People’s Computer Company wish to 
express the hope that the machines we play with be used to 
aid and increase living intellect and not to destroy it. 

Tom Williams 


KAPIAR ERRATA 

Dear Tom, Received: 78 Jan 23 

Here is an errata sheet for some of the goofs in my docu¬ 
mentation. (Sorry ’bout that...) 

p. 31, column 1, line 8 from bottom: insert ‘macro’ before the 
right paren; 

p. 32, column 2, line 9: ‘a@b@DEBLANK(b)’ should have 
been ‘a@DEBLANK(b)’; 
p. 32, column 2, line 12: ‘in’ should be ‘is’; 
p. 32, column 2, middle: ‘b@@a’ should be ‘b@ @a’; 
p. 33, column 2, line 26: ‘<parm 1>, . . .’ should have been 
‘<parm 1>",. ..’; 

p. 34, column 1, line 22 from bottom: ‘pairs of a’ should have 
been ‘pairs or a’; 

Finally, all the examples of ‘&’ as a continuation character 
were too long to fit the DDJ 2 column/page format, so the 
lines (as printed) are broken without continuation character, 
and continuation character ‘&’ is not followed by a new line as 
intended in the example. 

Cordially, 24225 Summerhill Ave. 

Steve Newberry Los Altos, CA 94022 


OTTAWA MICROCOMPUTING 

Dear Dr. Dobbs, Received: 78 Feb 6 

There is a club called “The Ottawa Computing Group” 
which is very active locally. Although electronic components 
are more expensive here (import duty, etc.), I would estimate 
there to be well in excess of 250 microcomputers operational. 
Interest is very high. Being the personal owner of an 
RCA COSMAC, I am disappointed that the use of this process¬ 
or is so low. There has been very little mention of this 
processor in Dr. Dobb’s which I hope will be rectified in the 
future. Perhaps an article by yourselves discussing a few of the 
nice features of the CDO1802 over other available processors 
might help stimulate more interest. In my estimation, the 
1802 is a superior MPU but few people realize that fact. 

Keep up the good work and keep those issues coming. 

Yours truly, 

D. C. Underwood 

Thanks for the encouragement and yes, we’d love to 
publish items of interest on the CDP1802 if folks out there 
would care to send us something. -TRW 


6502 DISASSEMBLER FIX 

Dear Dr. Dobb, Received: 78 Feb 22 

Since my Basic language disassembler for 6502 appeared in 
your Volume 3, Issue 1 as “Challenging Challenger ROMs”, 
I have discovered an omission. I somehow left out the ROR 
and ROL instructions. Apparently they don’t occur in the 
ROM areas I was examining at the time. The ROL mnemonic 
was in my data list although the decoding scheme I used would 
flag it as an illegal opcode. ROR is missing entirely. A proper 
fix would insert ROR after ROL in line 60 and completely 
rearrange the table in lines 210 to 520. This simpler fix also 
works. Just change the following lines. 

70 DATA SEI,STA,STX,STY,TAX,TAY,TSX,TXA,TXS,TYA,ROR 
230 DATA 10200,35222,56100,56100,56100,35203,3203,56100 
250 DATA 29300,2221,56100,56100,7200,2200,40200,56100 
260 DATA 39100,2210,40130,56100,7300,2300,40300,56100 
270 DATA 8200,2222,56100,56100,56100,2203,40203,56100 
280 DATA 44100,2304,56100,56100,56100,2303,40303,56100 
340 DATA 38100,1210,56130,56100,28325,1300,56300,56100 
350 DATA 13200,1222,56100,56100,56100,1203,56203,56100 
360 DATA 46100,1304,56100,56100.56100,1303,56303,56100 

Add 

611 IF C=56100 OR C 1100 THEN 1000 
Delete 630 and 631 

I’m enjoying the controversy you have generated over the 
Heathkit systems. Although I don’t use their computers, I 
did order some cassettes from the, believing that I could be 
certain of getting quality suitable for saving programs. The 
result has been disappointing. Although my Challenger uses 
the Kansas City format for recording (like Heath), all the 
Heath tapes consistently aquire a few errors in recording, 
and one is totally unusable. I don’t have these problems with 
other cassettes, and my recorder is the identical GE model 
sold by Heath. Buyer beware. 

Sincerely yours, P.O. Box 831 

Stephen P. Smith Parksley, VA 23421 


BEYOND THE 8080 

Received: 78 Feb 10 

Certainly. Am glad to tell you why I do not wish to 
resubscribe to your Journal. After two years of subscription, 
I find that the same people who started the Journal and 
writing for it still are doing so, still talking about 8080 mater¬ 
ials, little being written or published about 6502 or others. To 
check this imbalance, just take any five issues, as example, 
inventory those issues for content — by microprocessor type — 
and see for yourself. In other words, it appears to me that the 
“world” has passed you by. You are “out of step”. True, you 
have a market, but you are missing the far bigger and more 
diversified market that is there and needing your kind of help. 

If you change, I change. Until then, good luck. You had a 
a good idea! 

C. E. Brown 
Rt. 1 Box 159 B1 
White Stone, VA 22578 

Fact is, we probably are behind the times out here in 8080 
Land. But we’d be more than happy to publish stuff on 
6502’s and others if folks would write it up and send it to us. 
Dr. Dobb’s exists to help pass software around to the eager 
hands of users. _ jp \y 


Number 23 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 3 

105 



RENUMBERING &/\PPENDING gASIC PROGRAMS ON 

THE APPLE-II (COMPUTER 


BY STEVE WOZNIAK 

Apple Computer 

20863 Stevens Creek Blvd, B32 

Cupertino, CA 95014 

The laws of entropy insure that the line numbers of a de¬ 
bugged and operational BASIC program give the appearance 
of having been selected by a KENO machine. In fact, while 
several texts detail how the boundary conditions of a KENO 
game lead to predictable outcomes, finished programs seldom 
exhibit this property. Many a time I have spent an extra hour 
retyping a finished program while spacing the line numbers 
evenly just to make it “look good”. 

Another difficulty which I have experienced is joining 
two BASIC programs into a single, lafger one. This ‘append’ 
operation is easier to accomplish by hand than renumbering. 
The sophistocated user can examine the BASIC memory map 
and perform some manual manipulations to join the programs 
providing that the line numbers do not overlap. Still, the 
manual append operation is highly prone to error. 

The APPLE-II BASIC user now has a solution to these 
needs in the form of a hand- or tape-loadable program 
RENUM/APPEND, described herein. The CALL command 
is used to activate one of three machine level programs. The 
renumber operation (RENUM) requires user specification of 
the origiinal line number range over which renumbering is to 
occur, the new initial line number to be applied to the range, 
and the new line number increment to use. The example below 
specifies that lines 200 to 340 be renumbered starting with 
100 and spaced by 10’s. 

RANGE BEGIN 200 

RANGE END 340 

NEW BEGIN 100 

NEW INCREMENT 10 

A second RENUM entry renumbers the entire program, 
relieving the user of the need to specify the range begin and 
end parameters. The append operation (APPEND) reads the 
second user (BASIC) program off tape with the first in mem¬ 
ory. 

Renumber and append error conditions (memory full and 
line number overlap) are detected just as in BASIC. In case of 
error the user is notified and no program alteration occurs. 


Using RENUM/APPEND 


1. Load RENUM/APPEND (* 300.3D4 R) 

Note that the high-order bytes of page 3 are not loaded, 
preventing inadvertant alteration of the interrupt and user 
function (Y c ) vectors. The ‘ ’ is generated by the 
MONITOR, not the user. 

2. Load a BASIC program. 

3. To renumber entire program: 

POKE 2, START L User must supply low and high 
POKE 3, START H bytes of new STARTing line 


POKE 4, INCRL 
POKE 5, INCRH 

CALL 768 


number. 

User must supply low and high 
bytes of new line number 
INCRement. 

(does not alter locations 2-5) 


Note: START L is equivalent to START MOD 256 
START H is equivalent to START / 256 

4. To renumber a range of the program 
POKE 2, START L 
POKE 3, START H 


POKE4, INCRL 
POKE 5, INCRH 

User must supply low 
and high bytes of re¬ 
number range start¬ 
ing line number. 

User must supply low 
and high bytes of 
renumber range ending 
line number. 

(does not alter loca¬ 
tions 2-9) 

5. To append program #2 (larger line numbers) to program 
# 1 (smaller line numbers): 

(a) Load program # 2 

(b) CALL 956 

Be sure you are running the tape of program # 1 as this 
command will load it. 

(c) If you get a memory full error then use the command 
CALL 973 to recover the original program. 


POKE 6, RANGE START L 
POKE 7, RANGE START H 


POKE 8, RANGE END L 
POKE 9, RANGE END H 


CALL 776 


Errors 

1. If not enough free memory exists to contain the line num¬ 
ber table during pass 1 or RENUM then the message 
‘(beep) *** MEM FULL ERR’ is displayed and no renum¬ 
bering occurs. The same message is displayed if not enough 
free memory exists to hold the product of an APPEND. In 
the case of APPEND, the user will have to type the BASIC 
command CALL 973 to recover his original program. The 
user can free additional memory by eliminating all active 
BASIC variables with the CLR command. 

2. If renumbering results in a line number overlap (detected 
during pass 1 of RENUM) then the message ‘(beep) *** 
RANGE ERR’ is displayed and no renumbering occurs. 
This error may mean that one or more parameters were not 
specified or were incorrectly specified. 

Cautions 

1. When appending a program, always load the one with 
greater line numbers first. 

2. The user must be aware that branch target expressions may 
not be renumbered. For example, the statement GOTO 
ALPHA will not be modified by RENUM. The statement 
GOTO 100 + ALPHA will be modified only to reflect the 
new line number assigned to the old line 100. 

APPLE-II BASIC STRUCTURE 

An understanding of the internal representation of a 
BASIC program is necessary in order to develop RENUMBER 
and APPEND algorithms. Figure 1 illustrates the significant 
pointers for a program in memory. Variable and symbol table 
assignment begins at the location whose address is contained in 


Page 4 

106 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 23 


ihe pointer LOMEM ($4A and S4B where ‘S’ stands for hex). 
This is $800 (2048) on the APPLE-II unless changed by the 
user with the LOMEM: command. A second pointer, PV 
(Variable Pointer, at $CC and SCD) contains the address of the 
location immediately following the last location allocated to 
variables. PV is equal to LOMEM if no variables are actively 
assigned as is the case after a NEW, CLR, or LOMEM: com¬ 
mand. As variables are assigned, PV increases. 

Figure 1 - MEMORY MAP 


LOMEM (start of variables) 
($4A,4B) 


BASIC 

VARIABLES 


PV (Variable Pointer, end of variables) 
($CC,CD) 


constants are in this form including line number references 
such as 500 in the statement GOTO 500. Constants are always 
followed by a token. Although one or both bytes of a constant 
may be positive (less than $80) they are not tokens. 

Variable names are stored as consecutive ASCII characters 
with the high order bit set. The first character is between $C1 
and $DA (ASCII ‘A’ — ‘Z’), distinguishing names from 
constants. All names are terminated by a token which is recog¬ 
nizable by a clear high-order bit. The ‘S’ in string names 
such as A$ is treated as a token. 

String constants are stored as a token of value $28 followed 
by ASCII text (with high-order bits set) followed by a token 
of value $29. REM statements begin with the REM token 
($5D) followed by ASCII text (with high-order bits set) 
followed by the ‘end-of-line’ token. 


Figure 3 - ITEMS 


BASIC 

PROGRAM 


V -*-PP (Program Pointer, start of program) 

($CA,CB) 

first line 



HIMEM (end of program) 
($4C,4D) 


The BASIC program is stored beginning with the lowest 
numbered line at the location whose address is contained in 
the pointer PP (Program Pointer, at $CA and $CB). The 
pointer HIMEM ($4C and $4D) contains the address of the 
location immediately following the last byte of the last line of 
the program. This is normally the top of memory unless 
changed by the user with the HIMEM: command. As the pro¬ 
gram grows, PP decreases. PP is equal to HIMEM if there is no 
program in memory. Adequate checks in the BASIC insure 
that PV never exceeds PP. This is essence says that variables 
and program are not permitted to overlap. 

Lines of a BASIC program are not stored as they were ori¬ 
ginally entered (in ASCII) on the APPLE-II due to a pre- 
translation stage. Internally each line begins with a length 
byte which may serve as a link to the next line. The length 
byte is immediately followed by a two-byte line number 
stored in binary, low-order byte first. Line numbers range 
from 0 to 32767. The line number is followed by ‘items’ of 
various types, the final of which is an ‘end-of-line’ token 
($01). Refer to Figure 2. 

Figure 2 - LINE REPRESENTATION 


high 


f $01 I 


length line number items 

byte 


'end-of-line' 
token 


Single bytes of value less than $80 (128) are ‘tokens’ gen¬ 
erated by the translator. Each token stands for a fixed unit of 
text as required by the syntax of the language BASIC. Some 
stand for keywords such as PRINT or THEN while others 
stand for punctuation or operators such as *,’ or *+’. 

Integer constants are stored as three consecutive bytes. The 
first contains $B0-$B9 (ASCII ‘0’-‘9’) signifying that the 
next two contain a binary constant stored low-order byte 
first. The line number itself is not preceeded by $B0-$B9. All 


Constant: 


low 


high 


$B0-$B9 value 


positive 

token 


Name 


(ABC) : 


$C1 


$C2 | | $C3 | 

negative 
ASCII 



positive 

token 


String 

Constant 

("123"): | $28 |[ 

$B1 1 | $B2 | | $B3 | 

| $29 

quote 

token 

negative 

ASCII 

quote 

token 

REM: 

I $5D | 

i 1 1 i r 

1 | $01 1 



REM 

negative 

’end-of-1ine' 



token 

ASCII 

token 



Tokens: $00-$7F 

GO TO - $5F 
GOSUB - $5C 
THEN In - $24 
LIST - $74 
LIST , - $75 
STR CON - $28 
REM - $5D 
EOL - $01 


(tokens used by RENUMBER) 


Renumber — Theory of Operation 

Because of the rigid internal representation of APPLE-II 
BASIC programs (insured by the translator syntax check), 
writing a renumber program was a somewhat easier task than 
it would have been on many smaller BASIC’s. Fortunately 
all constants in APPLE-II BASIC (including line number 
references) are preconverted to binary. 

The normal renumber subroutine entry point is RENUM 
($308). The RENX entry ($300) conveniently sets the 
renumber range for the user such that the entire program will 
be renumbered. RENUM extensively uses SWEET16, the 
code-saving 16-bit interpretive machine built into the 
APPLE-II (Byte Magazine, Nov. 1977). Occasional 6502 code 
is interspersed throughout RENUM for even greater code 
efficiency. 

RENUM scans the entire program from beginning to end 
twice. During pass 1 a line number table is built containing 
all line numbers of the program found to be within the re¬ 
number range. This table begins at the address specified 


Number 23 


Or. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 5 

107 







by the BASIC variable pointer, PV, and is limited in length 
by the program pointer, PP. Each entry is two bytes long. 
A memory full error occurs if not enough free memory is 
available for the table. 

As line numbers are entered in the table corresponding 
new line numbers are generated and both new and old are 
displayed. Should the new line numbers result in an ‘out of 
ascending sequence’ condition, then a range error occurs 
and renumbering is terminated. It is assumed that the line 
numbers of the original program are in ascending sequence. 

The purpose of pass 2 is to scan the entire BASIC program 
while updating all references of line numbers found in the 
table to new assignments. Aside from the line numbers them¬ 
selves, the line number references sought are identified as 
constants immediately preceded by one of the following 
tokens: 

GOTO 
GOSUB 
THEN lno 
LIST 
LIST , 

No other statement normally permitted within an APPLE-II 
BASIC program may contain a line number reference. No 
errors will occur during pass 2. Exceptions such as empty line 
number table and null program are properly considered by 
both passes of RENUM. 


Append — Theory of Operation 

When APPEND is called, the user program with larger line 
numbers will be in memory and the one with smaller line 
numbers will be read off tape. The current program resides 
between two pointers, PP and HIMEM. HIMEM is preserved 
and set to the value contained in PP. This ‘hides’ the original 
program and prepares to load a new one immediately above 
it in memory. 

The BASIC load subroutine is called and a normal memory 
full error condition will result if not enough free memory is 
available to contain both programs. If this error occurs then 
the original program will still be hidden. Fortunately, it can 
be recovered by calling the tail end of APPEND at $3CD 
which simply restores HIMEM. If the load is successful then 
HIMEM is restored to its original value and both programs 
will be joined. No line number overlap check is performed. 


Original Program After Load HIMEM Restored 



PP-— 

PP-#- 




Prog ft 1 

Prog ft 

PP—— 

HIMEM-#- 




Prog ft 2 

Prog ft2 

Prog ft: 



(hidden) 


HIMEM—► 


HIMEM- 



P 


W 

•J 

a 

s 

< 

X 

w 

os 

w 

CQ 

2 

W 

os 


















o 









P 





















r- 









C/3 





O 

>0 




HD 


O 























iH 

in 


vO 


in 


in 














o 




O 

O 




r-H 

CM 

nO 

in 


CM 

yO 

CM 

lO 








2 

o 








P 

in 


'O 


1 


in 

CM 

vO 


in 


in 








to 

O' 








in 

CM 

y£) 

in 


o o 

Q 

CM 


in 

Q 

CM 

Q 

CM 








X 









o 


in 

CM 

rO 

o m 

O 


Q 

CM 

o 


o 








o 


* 








rH >, 

Q 

CM 


in 

r—1 H O 

2 

X 

o 


2 

X 

2 

X 






o 

vO 


o 








rH ,Q 

o 


Q 

CM 

r-H 



2 

s 











mm 

to 

CO 





*-» 



1 

2 

X 

o 


If) P 

O 

o 



o 

o 

O 

o 








r> 

mm 




II 


—A 

_ 

O T3 



2 

X 

CD cd >» 

m 

in 

o 

o 

o 

o 

— 

— 







CQ 

a 






f— 



O CD 

o 

o 



c .Q 

— 


— 

— 

— 

— 

— 

— 






o 

D 

H 

p 





2 


o 

rH O 

— 

— 

in 

in 

•H +J 









'O 





H 

in 


in 2 

2 

2 

2 

2 or. 


X 

H 

cd 





h k T3 

* 

* 

* 

* 

* 




r- O 

O 

o 

o 

o 

o 

o 

a 

*-• to 

(0 

to 

(0 

to o 

OS 

(0 

O 

w a 

* 

* 

* 

* 

ctf CD 

OJ 

n 


in 

v£> 


CO 

O' 

in 

yO 


CO 

O' 

CD 

CD 


j s 

as 

or. 

or 

a? u. 

a 

2 

CD 

CD C/3 

CM 

CD 

<T 

in 

^ P O 









mm 

mm 

mm 

mm 

—. 












C 





<d w a 
& a 

to 

X 

a 

to 

X 

to 

X 

to 

X 

to 

X 

to 

X 

a 

J A 
J 1 

A 

1 

A 

1 

A 

1 

A 

1 

H — 

in 

CM 

CD 

4 

50 

09 

70 

80 

00 

06 

o 

o 

CM 

O 

CD 

•H O 
r-H rH 

a 

to 

X 

to 

X 

a 

E O C/3 

o 

o 

o 

o 

O 

o 

o 

o 

< o n 

r^- 

O' 

o 

M 



mm 


mm 


— CM 

CM 

CM 

CM 


o 

o 

o 

o 

P P 

a 

CL 

a 

a 

a 

a 

0. 

a 

o o 

o 

o 

o 

mm 

J 











U 

a 

a 

a 

a 

c 

A 


A 

A 

A 

A 

A 

A 

A — 

mm 

mm 


mm 

A 











CD 

A 

A 

A 

A 

CD 






























OS 

























e 






p 

C 

CD 

PS 


u 

o 


2 O 
10 - 
X - 
n h ' 
O O O' 

o — to o 


II — 


m tc »-• h 

O n H H 2 H O 

pm inX2222X-fXH 

oot*. — fototouitooxtoo 
oidh joiSficJgu.a.zcj 

I— — (\]ro<ronr'-oooooo 
to o o o o — o — w m 

— — — — — — CMCMCMCM 

J 

A 


Page 6 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 23 


108 







>CALL 76B APPLE-1 I SASIC RENUMBER/APPEND SUBROUTINES 


CO 

l«J 

2 

f- 

p 

o 

x 

CD 

p 

CO 

Q 

2 

x 

0. 

0. 

<t 

V 

x 

W 

00 

S 

p 

2 

s 


»- 


y 





• 

CO 









CD 

uj 


• 







o 

• 





y 


m 


• 



X 







• 



2 

© 


y 



• 





n 





CD 




X 

• 


o 

y 






X 



<T 

2 


Id 



/-V 




to 

2 







»» 


U) 

X 

• 

X 

2 

• 





o 



X 



a 



r 


• 

• 

to 

Id 

• 




O 


— 


H 

UJ 

X 

X 


X 





H 




X 


2 



© 


X 

X 

<t 


X 




X 


X 


2 

H 

us 

Id 

X 

o 

• 




<t 

• 


£ 


• 


• 


X 


Id 

id 


X 

X 








*■* 

2 

y 


X 

X 

X 




J 

© 


p 

£ 

H 


y 


a 


a 

D 

• • 

J 

a 



• 

yC 


<o 


o 


2 

J 


X 

tn 

• 


• 

p 

2 


2 

D 

X 

J 

-4 




2 

2 

• o 

CD 

2 



UJ 

— 


—• 


a 

o 

*-« 

J 

J 

Id 

p 

y 

• 

X 

£ 

-J 

• 

UJ 

2 


CD 

X 


X 


M 

*—i 

O 2 

<E 




a 



> 



0. 

O 

p 

<t 


CO 

X 

X 

CQ 

p 


X 

X 

UJ 

y 

H 


• 

o 

• 



2 J 

H 




o 

10 

• 

CO 

• 

X 


X 

u. 


Id 


H 

X 

D 

u 

J 

L> 


X 

10 


J 

CD 


© 

o 

ID 

J 


o 



£ 


X 


X 

id 

o 



*-• 

O 

a 

2 

D 

to 

u 

< 

2 

X 



O 


X 

o 

U) 

o 

O 

> 

O 

o 

• 

• 


X 

x 

X 

UJ 

X 

o 

X 

£ 

u 

2 

< 

UJ 

to 


<* 


H 

o 

X 

Id 

2 

X 

X 

2 

X 

X 

X 

> Id 

2 

X 

• 

• 

O 

X 

Q 

UJ 

Q 

*■« 

X 

< 

Id 

Id 

<c 

o 



y 


y 



o 

-J 

J 

J 


X 


a. 

X 

UJ 2 

J 

X 

o 

<t 

2 

Q 

X 

a 

X 

X 

CL 

> 

£ 

Q 

X 

-J 


y 

D 

*> 

•-» 

o 

o 


ro 


m 

X 


X 



2 • 



• 

0 

~J 

r 

o 

or 

o 








—* 

UJ 

O 


2 

2 

*> 

o 

« 

•— 

<t 

o 


o 

•- 

o 


CVJ 

cvj 




o 

1 

o 

1 

o 

o 

o 

L> 

O 

o 

o 

H 

X 


y 

•-< 

J 

J 

2 

y 


y 

H 

£ 

H 


to 

X 



*-« 

M 

H 

i 

M 

i 



»-• 


*-• 

M 

*■* 


fd 


X 

Cd 




J 


CO 


<t 

Id 

< 

to 

•J 

f- o 

CO 

to 

M 

H 

CO 

> 

X 

> 

X 

to 

CO 

CO 

CO 

CO 

CO 

CO 

UJ 

X 

<c 

UJ 

> 

5 » 

> 


o 

to 

o 

X 

£ 

X 

CO 

<c 

X — 

CO 

to 

o 

o 

2 

o 


o 



<t 

« 


<t 

<C 

<t 

> 

<t 

X 

Sc 

Id 

UJ 

o 

M 

2 

<r 

2 

o 


L> 

< 


X X 

<r 

<t 

to 

CO 

O 

J 


-J 


m 

ra 

rn 

aj 

(TJ 

© 

CO 

CO 

u 

o 

CO 

2 

2 

j 

X 

-J 

0 . 

J 

CO 

X 

CO 

X 


2 X 

X 

X 

< 

<r 

o 


o 

* 









* * * 

* 

* 











to 



















a 








• 

* 






CD 

aj 

CD 

X 

O Id Q 

1- 



























o 

* 

to 





tO 

00 

O 

Q 

co cr uj 

<t 

















<t 


UJ 



ro 




_) 

^ 2 

« 

UJ 


<0 


o 

< O n 

CO 

td 

O 

oda 



















* 

0. 

CO 


* 

CVJ 



o 

y j 

K < 


♦ 

« 

h 

<r 

o — 



<T 

O O UJ 

UJ 

td 

X 

XXX 

a 

o — 

tO w 

CVJ 

ro 


to o 

K- 

CD 

to O 

CK 

<x 

co o 



o 


o 

—t 

♦ 

CO < 

UJ 


w 

to 



f- 

VO X 

* 





























* 

<t 

2 

X 


% 

yC 


z o; 

- td 

* 

o 



























• 

* 

nj q 

*-« 

UJ 

J 

c 



UJ UJ 

\ t~ 

* 

UJ 

K) Is) 

N) 

KJ 

KJ 

KJ KJ p 

r> 

D 

r> 

p p p 


KJ KJ 

KJ 

KJ 

KJ 

KJ KJ 

KJ 

KJ 

KJ KJ 

KJ 

KJ 

KJ KJ 

K) 

KJ 

KJ 

KJ 

KJ 


♦ 








CQ 

- D 

* 


X X 

X 

X 

X 

x x a 

a 

Cf 

c? 

a cn a 

H 

X X 

X 

X 

X 

X X 

X 

X 

X X 

X 

X 

x a 

0. 

X 

X 

X 

X 

•J 

X 

* 


D 

O 

p 


X 

C3 

id 

2 

X £ 

2 D 

— X 
£ 

* 

* 

CVJ 

Id UJ UJ 

Id 

UJ 

UJ Id Id 

UJ 

UJ 

id 

Id Id tu 

Id 

Id X 

X 

X 

X 

X X 

X 

X 

X X 

X 

X 

X X 

X 

X 

X 

X 

X 

X 

* 

» X 

X 


M 

o 

m 

UJ 

UJ 2 

o 

* 




























< 

* 

UJ'UJ 

CD 

Id 2 

2 



X UJ 

o 

* 




























• 

* 

J <D 

r» 

X 

M 


UJ 

UJ 

X 


♦ 





























* 

'X 2 

to 




o 

© 

Id 

KJ UJ 

* 

~J 





.J 


X 



J 


X 



H — 








CVJ 




w 

* 

X D 




> 

2 

2 

CO X 

o 3 

* 

H 





•J 


X 



H 

> o 



X x 




X 

X 

00 


X 




J 


<* 2 



UJ 

UJ 

< 

<C 

D O 

> x 

* 

H 




£ 

D 

o 

Id 


i- 

H 

02^ 


H Q 

£ 



Q 

Q 

2 2 

a 

a 




f- 


id 



2 

2 

X 

X 

X 

X 

* 

m 


-J 

X 

UJ 

X 

Id 

© 

Q 

«Oph 

m 

J 

_4 

o 

*-4 

CO 2 


CO £ O 

2 

2 

-J J 

2 

2 

o 

4 

X 

00 


X 








<t 

* 

n 

J X 

— 


£dJ£ 

a 

7 


— OP 

p o > 

> 

J 

X 

J J J X 

Id X 

to 

o > > 


© 

X 

X 

a 

H 











* 

CO 

o o 

-• 

— 

00 

X > UJ 

X 

< 

o 

r» or o 

CO 

UlilUZ 

2 

flO IQ 

CD 

O 

£ (_> X 

X 

X X 

co 

X x 

X 

o 




* 



* 


« 

# * 

* # < 

# 


X X 

X 

X 

X 

X X £ 

X 

X 

J 1/1 U L) 


<t 2 

2 

-J 

J 

f- H 

1- 

to 

X CO 

X 

X 

2 2 

H 

x u 

o 

£ 


o-cjn^m^Kcooo 

— CO © 

<T 

to 



CD 

<> 

O 

— CM 

© 


tn »o mo 

o 

o 

— CM 

CD 

<y 

to 

'O 


CO 

CK O 

— CM 

© 

«T 

in 

tO 

r- 

CD 


CVJ CVJ CM 

CM 

CM 

CM 

CM 

CM 

CM 

© 

© © 

© 

© 

© © © © 

© 


* 


<r 

<* 

<y 

cr 

<7 

<T lO 

co in 

m 

in 

in 

in 

m 

in 


2 

b) 

X o 
H in 


O 

h 
















O 

© 

X 

in 





00 


o 


<r 















© 


p 





II 


00 

M 


o: 
















ra 

X 






f“* 




© 















O 

D 

h- 

h 





2 

H 

o 


o 















H 

CO 


CO 

£ 

£ £ 

£ 

£ X 


X 

f- 

w 

X 















O 

O 

X 

M 

X 


X 

X o 

X 

X 

o 

J 

X 





O 

in 

o 

in 

o 

m 

O 

in 

O 


O 

© 

»— • 

_J 

or. 

X 

X X 

X 

2 

© 

a 






© 

© 

<T 


m 

in 

O 

nD 















X 

o 

m 

O 

in 

A 

A 

A 

A 

A 

A 

A 

A 

A 

h 

o 

in 

o 

in 

o 

in o 

in 


o 

in 

o 

< 

<r 

— 

— 

CM 

CM 

1 

i 

1 

1 

1 

1 

1 

1 

1 

CO 

00 


CM 

CM 

© 

© c 

<T 

in in 

o 

o 


X 

2 

A 

A 

A 

A 

o 

o 

O 

O 

o 

o 

O 

o 

o 

M 











w 

M 

1 

1 

1 

1 

m 

vO 

r» 

00 

o 

o 

00 

CM 

© 

J 












© 

— 

CM 

© 

<T 

— 

— 

— 

— 

— 

CM 

CM 

CM 

CM 

A 












Q 



W 

a 

a 

< 


x 

o 

x 

X 

f— 


X 


X 


<t 


H 


£ 


o 


X 

£ 

X 

<t 

X 

X 

© 

£ 

o 

<c 

X 

o 

X 

£ 

J 

<t 

< 

X 

2 

© 


o 

© 

X 

»—< 

X 

X 


o 

© 


*-« 

Id 

X 

X 

f— 

H 


£ s E 'O ££££££ 

X ro X in U1 X X X X Id 

XXX o x x x x x x 


f- O O O J 

CO O O O J 

— — c\» © <t 

J o 

A A 


h- o o o o o o 
CO — CVJ CD O O O 
*-* — CVJ rD 

J 

A 


Number 23 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 7 


109 













2 

« 

ft) 




• 

•« 


O 

Ul B 




o 



l) 

10 

X 

in 

r 



• ft 

to 


2 

m 3 




to 


10 

U 

to 



X o 

2 


J to 

< 10 

X 

® > 


X 


in 

X 


in 

2 • 



Ul J 


• 

CO 2 

H 

H 

2 O 




X 


CJ 

< 

— ft) 



o y 


— 

H — 

H 


— J 

• 

• 



H 

to 

X 

X 



2 IJ 

ft) 

2 

2 

O O 

> 


O' 

X 



to 



to 



— 2 


J 

N 2 

2 2 


H Ul 

O' 

X 


J 

o 

<r 

• 

r in 




H 

> 

<* 

J 

o 

X 2 

fj 

Ul 


J 

2 

i? 

Ul 

« 



UJ o 

X 

U 

X O 

X 

2 

Ul 




D • 



X o. 

CJ 

• 

J H 

U) 

2 

Q in 

2 — 

J 

2 v 

(J 

Ul 

2 

X 2 

R 

2 

2 

(J 

H • 

o 

X 

2 


M 

• o 



to 

o 

X 

X 

V 

Ul 


Q U) 

H X 

2 

<r — 


O 

Ul 

CJ X ft) 

• Q 

X O 

2 


p 

X D 


X 

H 

2 2 

cn uj 

J 

H 2 

X 

H 

J 2 J X Q 

2 J 


2 U J (T o: w I U 2 
- 2 t n • X • X ..J2 

-52 J 

araJOuiHOHO-:* 
2 (.) J J X 2 2 2 2 X Id 

<2— — <f 2 

» 5- x ft; x x 

I ~ _ 0. X — 


3 « O 2 £ O 
• O LI D J 

O 2 J 2 O 
« — or u 

« — 0. X 0. u u 

) O I- — 2 > 


n>o CD s Jod 
H Q < O Q to 
h 2 O J U CO 

0 2 JhOOX 

2 u) o C x 

jxr.HXwjo 
h J X o <t d u 

u. iu o y 

- 2 j x 


— h h x <f 

CJ <X 0 2 

CJ * Q 

d <d io or 

CO - D f J O 


• 2 < co Ul 

•2 CJ 2 2 % 

' (J X * O 2 

It- o o o Jo 

— I- - JO 

a. « 

> o * ■ — or 

' — o a * a h 

) to CJ to — to 

<c X x x 

ca o — to 


- o 5 

2 2 2 O — 

J — J J to 

^ > > in 

IJ IJ IJ U) <t 

2 2 2 2 0- 


J — — 

D 2 2 

L. J J K 

x :» ?• x 

(J (J U) Ul 
2 2 2 0: 


Q JXo2X2XXtro 
HQHr'X2HZHZ2X2 
w<tw 2 uaiXTC*)M ocn 


5 0 ftl W X H ftl % « 

' «* x x a x x :» — — o — 

s%Q Q 2 2 H Q O 2 222 

3<2IM2C5JW2 J J J — 2 
'ruui2(3i>:Q 

:xxioxdjffliDioid tijuiui 
30XXQX»0HHZ2#2Z2 


ft) N M 

X X a 

Q — Q 2 O 


ftl X Ql X O 
2XQOXQ20IO Uh 

OQ 2 WQ 2 OW 0 to to 


•— Q 

h ^ ? K 9 HO Q 0) Q CO K) 0. QhhUQX- KUKUKQ K ft! Hft! 

!jioto C ^?\m :2C ^Jrt C t , ^^ t ^ a ' C ^2 , "9 :DC>C1 “ >2oQt ” ultl,0:Qo * :Qa:2D -3 uD S oQ0 ' Mtl J(XtJ2O 

JtOtOJoCD — JlOJiOJlOOJ<tlOjtnn3JtOCDajlOlOtOOJQCQJoCQumQJCQQJoCQtOOCna3Q 

a. 


(T) IO 

D to «t 

IO <t C\J 


°‘5£!5!£2~-~- ,/>,or '“* >0 ' 0 "" <v,n ** n,0 ** eo<>0 — Ck,f ' , **o<OH» 0‘0 — ftir>fl>m»ftr**ccoo — fti«o.e 
, — ronooco'^^^^^^^^inintOiomtntomiOiO'OvO'O'O'OOO'O'O'Or'^f^^r^K^r-r^^.oocotDQOM 


UNBIQ-WOUOUUON 

n«tooQoo«jo^(jQo 


o<ym>or'~®<CQuiXft)ro<r 

tototoiotototntoiAtO'O^o 

ortoonononoonn 

OOOOOOOOOOOOO 


% cno, ° ° Ob. ft) O CJ OX X b. to X — 

J. 2 2 £ 5? £ rt £ S !C! 2 T. ° “2 08 s n m o r-r~ o r. m o K o <o r- w <m <t oi i~ r- v> c- I~ m « o o ■o eo q 

“ ""CMQOlJifinftinW" (M^OOIDIOOCDOUWN-- ^ i. n <f ft n i. ^ i*i i. ty q fi » q ft n i. 

'^^ t £9H!Er" CV, C?^' 0 ' 0 r ***00'<®OUlU.OCJr)«rt005 O <t CO Q LI h. - (\l 4 V) « » (M ffi Q O ^ n J) 

*C Kr-NN^NSf-tOBOCOfflCO cotooocococooaoooo.oooo<t<t<t<t 

r* ooooSooooooo — S3 2 2 2 2 S3 S3 2 (2 2 C? 2 2 2 •? 2 *2 «2 «2 <!> <? o w <•> r> n r> r> o <*> n n n 


14 


a 

< 

X 

H 

2 


bl 

H 

2 

J 

H 

H 

a 

7. 


bl 


2 

O CD 


< • 


UJ 

i 



— 

H H 

2 

0*2 

cr: 

a 


bl 


o 

PTR 

AND 

— 

0. w UJ 

D h- X 

a 

o • 

a 
• <x 

hi 

2 

CO 

2 

A X 

O X 

X 

z 

> 


< o • ~ ?. e 

tTQh* UJ Cl) cr 

o CL UJ CJ X x o 

it D2 X-OOl*. 

O O H H 

X or. o h o w 

O O UJ 2 I- UJ 

-*u.&!rot:ujv)cr 

h U] x 

CO 2 - O 

HJOOHOOH 

M W U) M « <t 

oQwwiiiwwc: 

3 J<0<t«0 
o CD CQ IO CQ CD lO 


E 

(J co 

2 CO 

K z <t 

H • ft. 

X X R 

O a bl 

012 2 

0-0 x O 

X J X Q Q 

ft. CO 0. 2 

H 0 2 

O Q tr Ul 

— 02 ft. X 

CO H <t H 

< U. 

03 — 


• * AO 

(J * l u 
J # • Q 

: o 

1 <* J o 2 

: • H Q 2 — 

• O O J 

— o o ~ 

• a 2 a — 

: j cm j — 

► o o o ft: 

i f“ O ifl % 

H >0 HO 

i o 2 or 

o Q • — w 

. a * or 

• < ♦ o. 


CO o to o — — 
<t O - O J X X 
0 0^0222 
«a to <r j j j 


« X > — XX 

i H O O * 2 ot * Q o 


X X 
Q X X Q 
2 O Q 2 a 


O o H ♦ 2 

(jOHUHXJhlDtOJ 
XJQ<D®D--QO — > 
OOXtAOtAO — — d(C>W 
KCa tUt,UdEO.uW2 


- O Q 

I O or CO X 2 « H Q HQ. ft. X XX O OKOXO»JQz4XX<tX*X<XXKX 

fJXU)3HHOHt0U)QHU)OHHOHHOHHQft.OH02Xo0QHOX2ft.22HHQOt0Ot0Ot0Oat0t0tnQ 

JO"ft»OtOt/>aX-5tOJt/ltOft.t/>tOJtOiOft.«OinJOCOtoJ — uUJiwjolDUffllDWXJJ’JJ-Jj^JJTJlJ 

X 

a 


cooanoQOQo 


MMMNNMMM 

aQ.CLa.o.a.a.a 

UUUUKOUlbJU) 


OJ 

X 2 

Q 2 O 

3 JO 2 O 
D If S P) (J W (C 
CtlJhlJ-XMO 
HOWCCHJW 


oo-wncrin'OH 

Ift'ftvO'ftO'O'fi'O'O 


m ® x 

D 2 

x M a 

i 

as 

d-BOO-N 

X x >o r*- 
<t - 


o-wo<TifioMDOO-wn«rft-fir>©0'0- 
o^tnvo^tcoo — «Mrj«rtnor*eoao — wr)«rioo^wo*OOoooooooo — — — — — — — — — — MtM 

r^r^r^r~^r'^coeooocoeoeo®eococooo<>0'<AOc>OtOa — — — — — — — — — — — — — — — — — — — w— — 


S u. h.OO Ul b. b. Ultlt 

— O O' O Ul O ® <t <M O — OC0 QQ(i)QN«Q)|i|O 

w ® <7 o <T n CM O O OO — <tuifflu — — — ®® 

• OOOOCOOWWWO'OtOtO — flt>O»H0>Ott>r><«OHr»<<*»<<*)M«CMH«Oi0'6O»O0'Otf>*>OOOtt 

X (Mfflnr)ltO(M-«£)n-OOP)MnOUOnNQOOOIMQOM<0«QOQOONO<<W<N<W<<NWOIN 

< 

o on<nn«oNBtauiiton«nflBMD»<t(DODLio-wn<f^MO(MCDQijocj( , )««ioDQONinN»uLN 

to oooooooooo------«------NNN«oifliWNNN(MWNnr)nnnrtnn<f^ccMtrMin 

•• noooncoortooonoooooMoortooonofooonOfooooowoooortnwnoortoooo 

CA OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO 


Page 8 

110 


Dr. Dobb's Journal of Computer Calisthenics 81 Orthodontia, Box E, Menlo Park, CA 94025 


Number 23 










o 


o 

<T 


IV 

4 


10 

U) 

2 


D 

O 

x 

ra 

o 

10 


O 

>o 

o 

CM 

lO 

o 


o 

n 

o 

eo 

<o 

o 


o 

2 

K 

0. 

< 

V 

X 

(0 

£Q in 
r o> 
o — 

2 O 

y o 

o 
o — 
— o 


to r- 
J O 
0. O 
ft. 

< 


o 

in 

o 


in 
< 

o 


CM 

O 


00 

<T 

o 


«o 

o 


n 

o 

cm 

o 


n 

n 

© 


o o 

O ID 

o o 


o 

00 


O M <0 9 N N 

<T O O OJ r> <y 


© 


O O 


O O O O 


o — r> 

0 0-7 

o- 

o o o 


o — <o m 

•o r*- co — 

o o o o 


— — <•> M CM 

o o o r» o 

cm o — o — 

o o o o o 


«o — — cm m> r- 
«o io w w w m 

o o o o o o 


co o to oj m — 

— © O' M 00 00 

— o o — — — 

O O O O o o 


Or^coMc'ono — c'jr-or-c'jocvjco — 

r^oooco — —<rr-r>-r^oo,r-r--ono>owoococo<roo 

_ — — — --— oo — — oocm — o — — ooo — — — 

oooooooooooooooooooooooooo 


<o — r-OJM — or>oooo«of~<roo 

OOCMOO — COOOCOO — — — COCMOO 
— — — OCM — OO — O — — — — — — — 

ooooooooooooooooo 


in cm o 

o - o 

CM CM CM 

o o o 

MO O 

o — o 

CM CM CM 

o o o 


r*» o cm o 

00 O CD CM 

O CM — — 

o o o o 


r- M) 

o m 


o o 


00 — CM O OO *0 «© 

oo o r- o o o 
O O CM — — o o 
o o o o o o o 


</nm to 
O' m m oo 

O — — — 

o o o o 


«T hO-rf)CMO 

oocoot'-'or* 
— O O OJ — — o 
o o o o o o o 


oo M CO <c CM O 
CO in CD M 00 to 
o — o — o — 
o o o o o o 


» m n 
m m o 

o o o 


!^m5^^mSRy!? 0 ' u ? C5D ‘ ,r,lt ® u,uw ® u ’* t:jwr, ' Wuu '0 < ^ cl<> ^ NU “ 0r ''OQ®U(DO<coO'UiTiDO'^/)'oajinQ^inc\J 
JOfOOOOOOfOujOOQCDMOeOOOOO'OmOOOOOOrom'O'O — «00 — OOOOOO — — 0*0000m0000‘000000000c*t0p' 

J2!!? 0 92C2 oQQor,00<noo00f,,0000 ooor)ooc->or>oinoooooooootjor)Of>>oooroo»oooooooroon 

• OOOOOOOU.U.OOOOOOOOU.UJOOOOOOOOOOOOOOUIOOOOOOOOOUJOOOOOOOOOU.OOOOOOOOO 


a 


Q ^ CM f- 2 JO— » XXX 

20 mm H O Z > D 22202 — CM OQQO 

WHOtff-HHOUIOWZZH^OQU.atil — JJjJ in in UI222 XJ 

O0.XXX22DO2»-ZUJU)CnXJ<fzSQ>>>»Q<fflO<(ncnJQoOOJXJ — — t 
OaXIIOOOcOOMtH«220li)UOUlliJ(illiJJ - — — WCCQ.CKO’ltrbOO — — * 
<4OOOOUl)OQ(3XXMjjDj££i;2Z2ZO0.EU>.2ui.(l.Q.Q.|li0.P.Lfi;(Cli;i£( 


- cm H 

0 2 XXX U1 

X cnoZQQQH H 

pXXeooo<tO'0—222 t/ >* <* 

■^-:XXXXO.K-JJJ.JJu<Moa 
•;h>mai®cDn x oan. 
.f- O D O 


o 

J 


o cr. 

»- o 

O u. 

o 

X 

in o 
— o 


u. 

•n * 

-* o 


2 J 
M 

X 2 
O 10 

I- X 


o 

2 

J 

cr 

o 

u. 

X 

o 

o 

J 


o 

2 

J 


2 


a 


J 

o 

w 


»- n 

in o- 



u. <r 
- z 
z 
o o 


h 
u) in 
Q — 
o J 
z 


x 
t- o 

U) 

cn 


o 

2 

J 


X X 
o o 
U. f 0 
X 

u o 

o 

O td 
Z H 

X Q 
<t 0. 
Id D 
J 


E 

U] 


o 

in 

«f 

CQ 

»- 

X 

bl 

2 

X 

o 

to 

X 

o 


H 2 2 H ^ h ^ W Z 
02UWZ 0<*tn<nZ0©U) 
-OXXO OCM — — OOOH 
Cuhhu <ta.JJO<tZ — 


cc i-ce a h co z o 

UNuawOMUD2DHX 

q is i/iu ui QfflininfQininm 


2 2 
O O 
o o 


in o mo 0 o-cMnMin'Of'B 

CO CO CO CO CO OO'O'OO'O'O'OO' 


o o 

o o 


u. <r O' <t M — — 

O CM O CQ r- o Q 


Q <0 Q Q O O'OQQO'OO — 

u.o — oo u.o — ajoajoo 


o 

r 

in 


Cd 

0. 

< 


to o* : 


z z 

Si! 2 


a 


XX 2 


O I- 

t— o 
in m 
to 


o 2 

J ^ 
O D 
►“ 
to 

cr. 


o X 

— * o 

in c_> X Z 

<f — X O w 

m > o in r 

in in • x 

- a 

l X t— 0. 

ojcnuiot- 

J *j in D. in 


■» O' ( 

O' X < 
cr u c 
o in i 


H o 

Id Q 

in j 


o o 
Q M> X Z x 
< - U U] o 
o>w i in 
• J in • x • 

a 

azxxa Q 2 in 

t-t-wwoot-f-f- 

in IT 1-3 0.J ifl C K 


t- Q 
2 
ft) 10 
D 0. 

in a 

< 


> — cMDMin'OP-eoO'O — (\i n 
>000000000 — — — — — . 
icmcmcmcmcmcmcmcmcmcmcmcmcmcm: 


) o 
. o 


o 

o 


«t 

o 


joocooo ooooocoooc 
J — OO — 'OP^OCMCMUCMr-O. 



<0^000 U.OCtlin<OCOO><( 
<tm® ®m®oo 
orjrjno cnr>nnoor>r> 
ooooo oooooooo 


r> uh.NncMDO"tQo-(\in<t # 

in 'TjnOOOOOOOOOQQQQO* 

- oooooocoooonrjmoo* 

O' OOOOOOOOOOOOOOO * 


Number 23 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 9 

111 







STRUBAL: A STRUCTURED BASIC COMPILER 

Gentlepeople: Received: 78 Jan 25 

This letter was inspired by the letter of Neils Laughlin in 
your issue No. 19 page 19. Mr. Laughlin is describing a pro¬ 
posed structured language for microcomputer use. I agree that 
the structures proposed by Djikstra and others (DO WHILE, 
IF-THEN-ELSE, etc.) are good for writing readable programs, 
yet I look at the sample listing on page 20 and it is far from 
readable. It took several minutes of reading to figure out what 
the program was doing. I feel that computer languages should 
not demand such effort from the reader. To show what I feel 
a good microcomputer language should look like, I enclosed a 
listing of the same program, coded in my partner (Jack 
Hemenway) and my new language: STRUBAL. (STRUctured 
BAsic Language™) This langauge is implemented as a full 
compiler which runs on 6800 processors with 16K of memory. 
The compiler is written in 6800 assembler language and is pre¬ 
sently running on a SWTP system with ICOM floppies, 
although STRUBAL has also run from a dual cassette system. 
The compiler runs in three passes. Pass one converts the source 
language input file into an equivalent assembly-language out¬ 
put file. Passes two and three are an extended 6800 assembler. 
The use of assembly langauge as the intermediate file allows 
the programmer to easily read the intermediate file, to opti¬ 
mize it if desired, and to intersperse his own assembly-language 
statements wherever desired. This “inline” or “crutch-code” 
facility gives the programmer great power. STRUBAL itself is 
a very powerful langauge. There are three data types sup¬ 
ported: integer (16-bit), floating-point (10 digit BCD), and 
character string (bytes). Full math support is provided in 
several run-time packages, (trigonometry, logarithms, etc.) 
String functions in the language include string comparisons, 
string concatenation, variable-length strings, string-to-value and 
value-to-string conversion, etc. STRUBAL code is fully relocat¬ 
able and separately compiled program modules may be linked 
to form a single program. Common data areas, external refer¬ 
ences, etc. are all handled by a relocating loader which is part 
of the system. Subroutine calls with named parameters are 
supported. Sequential and random disk file access is sup¬ 
ported. (Tapes have only sequential files, obviously.) 
STRUBAL has all of the structured-programming forms 
(WHILE, IF-THEN-ELSE, CASE, etc.), plus other forms taken 
from BASIC and FORTRAN. (IF-statement, GOTO, GOSUB, 
FOR-NEXT, CALL, etc.) PEEK and POKE are provided, as is 
a function to return the address of a variable or label. Any 
data type may be an array of one or two dimensions. Exten¬ 
sive I/O format capability is provided for either console or disk 
(tape) file I/O. No line numbers are used, since a full editor is 
available to build source files and only those lines requiring 
transfer labels need have labels—and the labels are alphanu¬ 
meric names, not hard-to-follow numbers. 

That was a quick survey of STRUBAL. It is a fast compiler 
... the sample program was fully compiled (3 passes) in less 
than four minutes. The assembler part of the package can as¬ 
semble the entire compiler in about 12 minutes, (on floppies) 
Much of this speed comes from a hash-coded symbol table and 
a binary-searched keyword table. Keywords are searched on 
their first three characters, symbols are searched on the first 
six characters. 

Let me make a few notes on the STRUBAL program listing. 
All lines with an asterisk in the first column are comments and 
will also appear in the assembly intermediate file. All 
STRUBAL functions are indicated by a dot. .RAND returns a 
pseudo-random 16-bit value. Slashes in I/O statements gene¬ 
rate carriage retum/linefeeds. A percent sign indicates string 
I/O. STRUBAL does not require the indentation for blocks; it 
was done for readability. The top line is the command to the 


MACROFLOPPY tm AT S695 

News Release Received: 78 Jan 5 

A new series of fully packaged and assembled disk drives 
priced as low as $695 — including software, S-100 compatible 
controller and 143,000 byte capacity — has been announced 
by Micropolis Corporation. Developed for the retail microcom¬ 
puter market, the new MacroFloppy tm series initially includes 
two versions: 

Model 1041 packages a drive, enclosure, cabling and con¬ 
nectors, disk operating system and disk extended BASIC at a 
suggested retail price of $695. It is intended for integration 
into any 8080A or Z-80 microcomputer chassis. 

Model 1042, suggested retail of $795, adds a power supply 
and DC regulators for desktop use. 

Delivery is 30 days on both models, and they are factory 
warranted for 90 days. 

Both systems come with complete file protect and built in 
ROM bootstrap. MacroFloppys are hard-sectored into 16 
sectors each 256 bytes long; total tracks per surface is 35. 
Both offer transfer rates of 250K bits/second at an average 
rotational latency time of 100 msec. Access time track to 
track is 30 msec, and recording density 5162 bits per inch. 

The disk operating system offered with each MacroFloppy 
subsystem is a complete package including assembler, file 
management routines and utilities to support 8080A and 
Z-80 programs. MacroFloppy DOS will function in micro¬ 
computer systems with at least 16K of main memory. The 
company’s disk extended BASIC requires 24K of main 
storage. Contact Micropolis Corporation, 7959 Deering Ave, 
Canoga Park, CA 91304, (213) 703 -1121. 


ICOM disk system to print the file “&GUSS” from disk one. 

Since STRUBAL is a full compiler, all debugging tools used 
in assembler programming can be used with it. STRUBAL 
assumes some system monitor (like MIKBUG), but any reason¬ 
able monitor can be patched in. It is fully debugged and opera¬ 
tional now. 

Enough sales-pitch for now. We hope to market STRUBAL 
soon, and will be selling full source listings. STRUBAL is a lot 
more complex than a “tiny BASIC”, but I feel it returns a lot 
of power for the investment. 

Sincerely yours, 

Robert D. Grappel 
148 Wood Street 
Lexington, MA 02173 


PRINT,AGUSS*1 

* NUMBER-GUESS PROGRAM IN STRUBAL LANGUAGE 

* ILLUSTRATES STRUCTURED-PROGRAMMING 

* NOTEi RNDNO LIMITED TO RANGE I-IOO 

* 

INI EGER RNDNO.NGUESS,GUESS 
DSiRING YES.GSTAT 

* 

SIRING YES='Y' 

SIRING GSTAT-YES 

* 

rtHILE GSiAf .EQ. YES 

fiNDNO*. ABS I.RANDI I ) )/22H 
NGUESS*I 
GUESS*-I 

WHILE GUESS .NE. RNDNO 

INPUT /."GUESS*".GUESS,/ 

IF GUESS.LT. RNDNO PRINT ' TfX) LOW"./ 

IF GUESS.EG.RNDNO PRINT /,'O.K. IN ".NOUFSS./ 
IF GUESS.GT.RwDNO PRINT " TfX) HIGH',/ 
NGUESS*NGUESS+I 

BLOCK 

* 

INPIU /."PLAY AGAIN? (Y OR N)".%GSTAT 

BLOCK 

* 

STOP 

END 


Page 10 

112 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia. Box E, Menlo Park. CA 94025 


Number 23 



A Z~80 Tracer 


Dear Dr. Dobbs, Received: 78 Feb 12 

Here is a program which I think will be of some value to 
your readers! Since you have never to my knowledge 
published a Z-80 program, I thought that I might as well 
get things off the ground. 

This program is a valuable debugging tool. It will move a 
breakpoint through the object program while executing it. 
The breakpoint is a restart 070 8 that jumps to a register dump 
routine. The dump routine will jump to TRACER after 
displaying the registers. TRACER will then restore the object 
program op code at the location of the breakpoint. It will 
then calcluate the location of the next op code to be executed, 
load the first two bytes into the Tracer program, insert a 
restart at that location, then restore all the prime registers. It 
will then return to the object program where it was 
interrupted and execute the restored op code. 

The TRACER program uses the DIGITAL GROUP Z-80 
operating system register dump routine, but can be used with 
any routine to display any type of data desired. The routine 
must push all prime registers into the stack located at 
002000 8 (the stack cannot be used by the object program). 
The TRACER program starts at 006110 8 . Then after storing 
the stack pointer it will jump to the dump routine at 006134 g . 
The dump routine must jump back into TRACER at 006154 8 . 
All inputs and outputs are done in the dump routine. 

To use TRACER, load a 377 8 (restart jump to 006110 8 ) 
at the location where debugging is to begin. Then load B1&B2 
in TRACER with the first two bytes of the op code. When the 
object program is executed the registers will be displayed 
(or any data desired) when the restart is encountered. 

All addressing is in split octal mode. This program will 
only work on a Z-80 system but will trace 8080 programs 
since it is a subset of the Z-80 language. 

Sincerely, USAFSS, Box 18627 

Arthur W. Cline San Antonio, TX 78243 

(512)925-2380 


006110 355 163 166 006 

006114 355 163 151 006 

006120 042 132 006 

006123 341 

006124 053 

006125 061 000 002 

006130 345 

006131 041 *** *** 

006134 303 000 003 

006137 041 022 000 

006142 071 

006143 371 

006144 341 

006145 321 

006146 301 

006147 361 

006150 061 *** *** 

006153 311 

006154 026 377 

006156 052 314 007 

006161 355 163 316 007 

006165 061 *** *** 

006170 175 

006171 137 

006172 376 375 

006174 312 352 006 

006177 376 335 

006201 312 352 006 


PREDUMP LD(006166),SP 
LD(00615l),SP 
ID(006132),HL 
POP HL 
DEC. HL 

RETURN LD SP,(002000) 
PUSH HL 
LD HL,****** 
JP (LUMP) 

LD HL,000022 
ADD HL,SP 
LD SP,HL 
POP HL 
POP DE 
POP BC 
POP AP 
LD SP,****** 
RET 

START LD D,377 

LD HL,(b2,bl) 
LD (sp),SP 
LD SP,****** 

LD A,L 
LD E,A 
CP 375 
JP Z,(IX) 

CP 335 
JP Z,(IX) 


006204 376 313 
006206 312 024 007 
006211 376 355 
006213 174 
006214 312 334 006 
006217 376 351 
006221 312 131 007 
006224 001 012 000 
006225 000 
006230 041 322 007 
006233 355 261 
006235 257 
006236 271 
006237 173 
006240 302 244 007 
006243 173 
006244 001 011 000 
006247 355 261 
006251 257 
006252 271 
006253 302 014 007 
006256 173 
006257 001 023 000 
0Q6262 355 261 
006264 257 
006265 271 
006266 302 024 007 
006271 173 
006272 001 023 000 
006275 355 261 
006277 257 
006300 271 
006301 302 210 007 
006304 173 
006305 001 007 000 
006310 355 261 
006312 257 
006313 271 
006314 302 112 007 
006317 173 
006320 001 007 000 
006323 355 261 
006325 257 
006326 271 
006327 302 162 007 
006332 030 101 
006334 001 012 000 
006337 041 075 010 
006342 355 261 
006344 257 
006345 271 
006346 040 031 
006350 030 052 
006352 174 
006353 001 031 000 
006356 041 031 010 
006361 355 261 
006363 257 
006364 271 
006365 040 025 
006367 173 
006370 001 013 000 
006373 355 261 
006375 257 
006376 271 
006377 040 023 
007001 341 
007002 053 
007003 345 
007004 173 
007005 167 
007006 043 
007007 043 
007010 043 
007011 043 
007012 030 137 
007014 341 
007015 053 
007016 345 
007017 173 
007020 167 


CP 313 

JP Z,(2BYTE) 

CP 355 
LD A,H 

JP Z, (ESCAPE) 

CP 351 

JP Z,(JP(HL)) 

LD BC,000012 
NOP 

LD HL,007322 
CPIR 
XOR A 
CP C 
LD A,E 

JP NZ,(RETTST) 
LD A,E 

LD BC,000011 
CPIR 
XOR A 
CP CL 

JP NZ,(3BXTE) 

LD A,E 
LD BC,000023 
CPIR 
XOR A 
CP C 

JP NZ,(2BYTE) 

LD A,E 
LD BC,000023 
CPIR 
XOR A 
CP c 

JP NZ, (CALLTST) 
LD A,E 
LD BC,000007 
CPIR 
XOR A. 

CP C 

JP NZ,(RSI) 

LD A,E 

LD BC,000007 
CPIR 
XOR A 
CP C 

JP NZ,(JRTST) 
JR(IBXTE) 

ESCAPE LD BC,000012 
LD HL 010075 
CPIR 
XOR A 
CP G 

JR NZ,(4BXIE) 

JR (2BYTE) 

IX LD A,H 

LD BC,000031 
LD HL,010031 
CPIR 
XOR A 
CP C 

JR NZ,(3BXTE) 

LD A,E 
LD BC,000013 
CPIR 
XOR A 
CP C 

JR NZ,(2BYTE) 
4BYTE POP HL 
DEC HL 
PUSH HL 
LD A,E 
LD (HL),A 
INC HL 
INC HL 
INC HL 
INC HL 
JR(PREEND) 

3BXIE POP HL 
DEC HL 
PUSH HL 
LD A,E 
LD(HL) ,A 


Number 23 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 11 

113 



007021 043 



INC HL 

007163 

061 

374 

001 


007022 

030 

005 


JR 005 

007166 

062 

172 

007 


007024 

341 


2BYTE 

POP HL 

007171 





007025 

053 



DEC. HL 

007172 

##* 

006 



007026 

345 



PUSH HL 

007174 

355 

173 

166 

006 

007027 

173 



LD A,E 

007200 

030 

222 



007030 

167 



LD (HL),A 

007202 

355 

173 

166 

006 

007031 

043 



INC HL 

007206 

030 

254 



007032 

043 



INC HL 

007210 

173 




007033 

030 

116 


JR (007153) 

007211 

061 

374 

001 


007035 

341 


1BYTE 

POP HL 

007214 

062 

223 

007 


007036 

053 



DEC HL 

007217 

361 




007037 

345 



PUSH HL 

007220 

061 

377 

377 


007040 

173 



LD A,E 

007223 

*** 

235 

007 


007041 167 



LD (HL),A 

007226 

355 

173 

166 

006 

007042 

043 



INC HL 

007232 

303 

014 

007 


007043 

030 

106 


JR (007153) 

007235 

355 

173 

166 

006 

007045 

341 


CALL 

POP HL 

007241 

303 

045 

007 


007046 

053 



DEC HL 

007244 

061 

374 

001 


007047 

345 



PUSH HL 

007247 

062 

256 

007 


007050 

173 



LD A ,E 

007252 

361 




007051 167 



LD (HL),A 

007253 

061 

320 

007 


007052 

043 



INC HL 

007256 

*** 




007053 136 



LD E,(HL) 

007257 

355 

173 

166 

006 

007054 

043 



INC. HI 

007263 

303 

035 

006 


007055 

126 



LD D,(HL) 

007266 

355 

173 

166 

006 

007056 

353 



EX DE.HL 

007272 

3Q3 

143 

007 


007057 

176 



LD A,(HL) 

00727/5- 355 

173 

316 007 

007060 

066 

377 


LD (HL),377 

007301 

043 




007062 

030 

071 


JR(007155) 

007302 

176 




007064 

341 


JR 

POP HL 

007303 

062 

315 

007 


007065 

053 



DEC HL 

007306 303 

137 

006 


007066 

345 



PUSH HL 

007311 000 




007067 

173 



LD A,E 

007312 

000 




007070 

167 



LD (HL),A 

007313 

000 




007071 

043 



INC. HL 

007314 

**# 




007072 

176 



LD A,(HL) 

007315 

*** 




007073 

270 



CP B 

007316 

**# 




007074 

372 

103 007 


JP M,007103 

007317 

**# 




007077 

043 



INC HI 

007320 266 




007100 

205 



ADD L 

007321 007 




007101 

030 

004 


JR (007107) 






007103 

057 



CPL 







007104 107 
007105 175 
007106 220 
007107 157 
007110 030 
007112 341 
007113 053 
007114 345 
007115 173 
007116 167 
007117 356 
007121 074 
007122 157 
007123 046 
007125 371 
007126 341 
007127 030 
007131 341 
007132 053 
007133 345- 
007134 173 
007135 167 
007136/ 052 
007141 030 
007143 341 
007144 053 
007145 345 
007146 173 
007147 167 
007150 341 
007151 341 
007152 000 
007153 176 
007154 162 
007/155 062 
007160 030 
007162 173 


041 

307 

000 

022 


366 001 
010 


CALMS! 


RETTST 


END. 


314 007 
113 


LD B,A 
LD A,L 
SUB B 
LD L.JL 
JR (007153) 
RST POP HI 
DEC- HL 
PUSH HI 
LD A,E 
LH (HL) f A 
XOR 307 
INC A 
LD L,A 
LD H,000 
LD SP,HL 
POP HL 
JR (007153) 
JP(HL) POP HL 
DEC HL 
PUSH HL 
LD A,E 
LD (HL),A 
LD HL,(001366) 
JR(007153) 

RET POP HL 
DEG HL 
PUSH HL 
LD A,E 
LD (HL),A 
POP HL 
POP HL 
NOP 

LD A,(HL) 

LD (HL),D 
LD (007314),A 
JR (END) 

JRTST LD A..E 


co 

a 

E-t 


HCVJCVjr^rOrnrO^rriO 
ir\C H cm c^O 
O O O H rH H pH pH pH O 


HHH rnroH H H f^ino 
pH rnvo 

ooooornnrnnno 


■^■lAOHCMrn^iA^-VO'-O^DVOVOVOVOVOkOvr) 

VOVOVO^OVOVOVOVOVOOpHCNJrO-^-mC^OpHCNJ 

OOpHpHpHpHHpHHHHpHpHpHHpHC\JC\JC\J 

H 

rn 

o 

o 

rH 

o 


t'-K^N^^OOOOOOOO 
H (\J r^H-in^) OOJ^^LA^Oh-O 

rnrnrnrOrnrnOOOOOOOO 


C\JOsJC\JC\JCMC\JC\JC\JrnH-H-H-H-H-^-H-H-ir> 

OrHCsJro^mVOC^OOpHOsjrO-^-irvVOC^-pH 


vovovovovovovovororo^vovovovovpvovB 
OH C\J r^(\J r^OH (\J 

OOOOOOOO^^f^^^ronrOrOrO 


OOOOOOOOpHOpHHpHHOJCMCVJCNJO 

OpHCsjroH-in'Oc^HOOcvj^i-vo^irv'sdc^O 

rnrnr0rnrnrnn-»r0rnOOOOOOOOOO 

C\J 

CO 

rO 

O 

O 


Page 12 Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 

114 


LD SP,001374 
LD (00717/2),A 
POP AP 
JR*(007202) 

LD SP, (006166) 
JR (2BYTE) 

LD SP,(006166) 
JR (JR) 

LD A,E 

LD SP,001374 
LD(007223),A 
POP AP 
LD SP,377377 
***007235 
LD SP,(006166) 
JP (3BYTE) 

LD SP,(006166) 
JP (CALL) 

LD SP,001374 
LD (007256),A 
POP AP 
LD SP,007320 
RET * 

LD SP,(006166) 
JP (lBYTE) 

LD SP,(006166) 
JP (RET) 

LD SP, (007/316) 
INC HL 
LD A,(HI) 
LD(007315),A 
JP (RETURN) 

NOP 

NOP 

NOP 

B1 

B2 

SP L 
SP H 

DUMMY SP L 
DUMMY SP H 



(0(0(0(0(00 
<~OH- lP»^D 
C\J C\J CVJ CM CM O 



Number 23 



A KIM Binary Calculator 




BY JOHN EATON 

1126 N 2nd 
Vincennes, Ind. 47591 
Copyright 1977 


Binary math has always been a stumbling block for anyone 
attempting to study the inner workings of a computer. No 
matter how often you work problems in binary, octal or 
hexadecimal, you can never work as efficiently as you can in 
decimal. Most of us when confronted with a problem involving 
other number systems will have to reach for a pencil and paper 
in order to obtain a result. 

But now there is an easier way to solve binary math 
problems. With this software your KIM-1 or other 6502 
system can do all the work and give you the result in a form 
that you can understand. The program is a machine language 
routine that will fit in less than IK of memory. It communi¬ 
cates with the user through any ASCII I/O device. 

The program will work with binary numbers up to 16 
bits. They can be inputted to the program in decimal, hexa¬ 
decimal, octal, binary or as an ASCII literal character. The user 
may specify whether the results are displayed in decimal, 
hexadecimal, octal or binary. With these features the program 
is able to convert numbers between different bases. 

Several logic functions are available. The program will 
take any two 16 bit numbers and perform the operations 
of AND, OR, NOR, EOR and NAND. You may also perform 
the arithmetic operations of addition and subtraction. The 
inverse and two’s complement of any 16 bit number can be 
found. 

There are two rotate commands available. The rotate 
commands treat two 16 bit numbers as a single 32 bit number 
and can shift it left or right up to 16 bits. 

Using the Routines 

The program requires a MOS 6502 based system and must 
have a rotate right instruction. If you have one of the earlier 
processors then you will have to modify the code around 
address 327E to perform eight ROL’s for each ROR. The pro¬ 
gram is assembled starting at address 3000 but is small enough 
that it will fit in a KIM-1 without any additional memory. 
The starting addresses for the user’s I/O routines go in the 
first 9 bytes. You will need a single character input routine, 
single character output routine and a routine that performs 
a carriage return and linefeed. 

Start the program at address 3010. It should respond with 
a carriage return and linefeed. The first thing that you should 
do is set the display mode. Type either DEC, HEX, OCT, or 
BIN depending on what mode you want the result to be 
displayed in. The mode that you type will remain in effect 
until you specify a new one. The program will respond by 
displaying the current value of its display register. 

The ENT command is used to enter numbers into the 
display register. Type ENT and a space followed by a number. 
If the number is other than a decimal number, it must be 
preceded by a % for binary, @ for octal, $ for hex and “ for an 
ASCII literal. ASCII literals must end with a ”, The number 
must be an integer and may be preceded by a ” if the two’s 


complement of the number is wanted. Once a number is 
displayed by the program you can use it in various ways. If 
you type INV or TSC then the inverse or two’s complement of 
the number is displayed. 

Several operations require the use of a second number to 
produce a result. Logical functions are available by typing 
AND, OR, EOR, NAND or NOR. Each of these commands 
must be followed by a space and a second number. The 
number can be in the same format as in the ENT command. 
The result of the operation will be displayed. The commands 
ADD and SUB may be used in a similar manner for integer 
arithmetic. 

The rotate commands require a special format. To use them 
type ROL or ROR followed by an integer number in paren¬ 
thesis. This number specifies the number of bits that are to 
be shifted. The parenthesis must be immediately followed 
by a 16 bit number that is to be shifted into the display 
to replace the bits that are shifted out. 

The program does all binary/decimal conversions with 
counting loops. It’s very easy to write but extremely slow. 
The worst case time for any conversion is 5 seconds so if 
you want fast results use a non-decimal display mode. 

Isn’t it nice to now have a computer that can solve prob¬ 
lems that you never would have to solve if you didn’t have 
a computer? 


0000 



DISL 


Display 

0001 



jISH 


register 

0002 



JECL 


dec/bin conversion 

0003 



bECH 


register 

0004 



BUFL 


Buffer 3 Bytes 

0005 



BUFH 



0006 



BUF0 



0007 



P0IN 


input line pointer 

0008 



MODE 


display mode 

0009 



SHIFT 


ft of bits per char 

000A 



MASK 



000B 



SIGN 



oooc 



VEB 



000D 



VEB+1 



n 00E 



VEB+2 



0010 



LR 


line register 32 bytes 

3000 6C 

00 

00 

INPUT 

JMP CHAIN 

user input routine 

3003 6c 

00 

00 

0TPUT 

JMP CHAR0T 

user output routine 

3006 6C 

00 

00 

GRIP 

JMP CARLF 

user carret/lf routine 

3009 EA 




NOP 


300A 20 

03 

30 

OUT 

J SR OTFUT 

display number 

300D 68 



DISPLA 

PLA 

300E DO 

FA 



BNE OUT 

characters on stack 

3010 A9 

01 


START 

LD Arir 01 

Start program here****** 

3012 85 

o? 



STA POIN 


3016 20 

06 

30 


JSR CRLF 


3017 C6 

07 


BACK 

DEC POIN 


3019 20 

00 

30 

LOOP 

JSR INPUT 

fetch character in Accum 

301C C9 

08 



CMP#08 

backspace? 

301E F0 

F7 



BEQ BACK 

yes 

3020 A6 

07 



LbX POIN 


3022 95 

10 



STA LR,X 

save character in pg 0 

3026 e6 

07 



INC POIN 

3026 C9 

ou 



CMPtfOD 

carriage return? 

3028 DO 

EF 



BNE LOOP 

302A 20 

06 

30 


JSR CRLF 


302b )& 




CL!) 


302E A0 

04 



LDY#06 


3030 20 

95 

30 


J SR LOAD 

load number into buffer 

3033 20 

D7 

30 


JSR OP 

perform operation 

3036 A2 

01 



LDXjYOI 

3038 35 

00 


MOVE 

LbA JlSL.X 

move display register 

303A 95 

04 



STA BUFL,X 

into buffer and invert 

303 c 69 FF 



E0rl#FF 

into dec/bin conversion 

303E 95 

02 



STA DECL.X 

register 

3060 CA 




7 EX 

3061 10 

F5 



BPL MOVE 


3063 A9 

00 



L /MOO 


3065 85 

06 



STA BUFD 


304? 48 




PHA 

end of stack storage 


Number 23 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 13 

115 




3048 A6 

08 



LjX MOjE 

display mode 

3103 

20 

58 31 

SUB 

JSR TSCB 

304A DO 

27 



BNE DIS1 

non decimal 

3106 

A9 

75 

ADD 

LDA# 7 5 

304C F8 




SEj 


3108 

DO 

19 


BNE EXEC 

304D 20 

D9 

31 


J SR SET9 

Buffer=999999 

310A 

A9 

31 

NAD 

LDA#31 

3050 38 



DEC1 

SEC 

add 1 to buffer 

310C 

48 



PHA 

3051 A0 

02 



LDY#02 


31OD 

A9 

13 


LDA#13 

3053 A2 

00 



LDX#00 


310F 

48 



PHA 

3055 85 

04 


DEC2 

LDA BUFL.X 


3110 

A9 

35 

AND 

lda#35 

3057 69 

00 



ADC#00 


3112 

DO 

OF 


BNE EXEC 

3059 95 

04 



STA BUFL.X 


3114 

20 

DD 31 

INV 

JSR SETF 

305B E8 




I NX 


3117 

A9 

55 

EOR 

LDA#55 

305c 88 




DEY 


3119 

DO 

08 


BNE EXEC 

305D 10 

F6 



BPL DEC2 


311B 

A9 

31 

NOR 

LDA#31 

305F E6 

02 



INC DECL 

add 1 to JECL 

311D 

48 



PHA 

3061 DO 

ED 



BNE DEC1 


311E 

A9 

13 


LDA#13 

3063 E6 

03 


DEC 3 

INC DECH 


3120 

48 



PHA 

3065 F0 

06 



BEQ DEC4 

finished counting 

3121 

A9 

15 

ORR 

LDA#15 

306? 20 

6A 

32 


J SR ADD256 

add 256 to buffer 

3123 

85 

oc 

EXEC 

STA VEB 

306A 4C 

63 

30 


JMP DEC3 


3125 

A9 

00 


LDA#00 







3127 

85 

OD 


STA VEB+1 

306D A0 

14 


DEC4 

LDY#14 

lenght* 20 bits 

3129 

A9 

60 


lda#6o 

306F A2 

04 



LDX#04 

bits/char* 4 

312B 

85 

OE 


STA VEB+2 

3071 DO 

03 



BNE DIS2 

unconditional branch 

312D 

18 



CLC 







312E 

A2 

00 


LDX#00 

3073 BC 

65 

32 

DIS1 

LDY TAB2-1.X 

fetch lenght 

3130 

AO 

01 


LDY#01 

3076 86 

09 


DIS2 

STX SHIFT 


3132 

B5 

04 

EXEC1 

LDA BUFL.X 

3078 D8 




CLD 


3134 

20 

OC 00 


JSR VEB 

3079 A6 

09 


DIS3 

LDX SHIFT 

fetch LSD and save on stack 

3137 

95 

00 


STA DISL.X 

307B A9 

80 



LDA#80 


3139 

E8 



I NX 

307D 20 

7E 

32 

DIS4 

JSR ROTATE 


313A 

88 



DEY 

3080 88 




DEY 


313B 

10 

F5 


BPL EXEC1 

3081 30 
3083 CA 

8A 



BMI DISPLA 
nFY 

display all characters 

313D 

60 



RTS 

3084 DO 

F7 



BNE DIS4 


313E 

A5 

04 

ENT 

LDA BUFL 

3086 4A 



DIS5 

LSR A 

char in A,shift to lo end 

3140 

85 

00 


STA DISL 

3087 DO 

FD 



BCC DIS5 


3142 

A5 

05 


LDA BUFH 

3089 C9 

OA 



CMP#0A 

convert to ASCII 

3144 

85 

01 


STA DISH 

308B 90 

02 



BCC DIS6 


3146 

60 



RTS 

308D 69 

06 



ADC#06 







308F 69 

30 


DIS6 

ADC#30 


3147 

A9 

01 

BIN 

LDA#01 

3091 48 




PHA 

save char on stack 

3149 

DO 

OA 


BNE MOD 

3092 4C 

79 

30 


JMP DIS3 


314B 

AQ 

03 

OCT 

LDA#03 







314d 

DO 

06 


BNE MOD 

3095 A2 

04 


LOAD 

LDX# 04 

number load routine 

314f 

A9 

04 

HEX 

LDA#04 

3097 B9 

10 

00 

L0AD1 

LDA LR,Y 

Y points to start 

3151 

DO 

02 


BNE MOD 

309A DD 

D2 

30 


CMP LOAD8,X 

match to 












3153 

A9 

00 

DEC 

LDA#00 

309D FO 

15 



BEQ L0AD4 

match found 

3155 

85 

08 

MOD 

STA MODE 

309F CA 




DEX 


3157 

60 



RTS 

30A0 DO 

F5 



BNE LOAD1 







30A2 A2 

04 



LDX#04 

decimal input 

3158 

A2 

04 

TSCB 

LuX#04 

30A4 20 

97 

31 


JSR LOADT 

input number 

315A 

DO 

02 


BNE TSC1 

30A7 20 

E6 

31 


JSR DECHEX 

convert to hex 

315C 

A2 

00 

TSC 

LDX#00 

30AA A5 

OB 


L0AD2 

LDA SIGN 

complement if "-" 

315E 

38 


T JC 1 

SEC 

30AC C9 

21: 



CMP#"-" 


315? 

98 



TYA 

30AE DO 

03 



BNE LOAD3 


3160 

48 



PHA 

30B0 20 

58 

31 


JSR TSCB 


3161 

AO 

01 


LDY#01 

30B3 60 



LOAD 3 

RTS 


3163 

B5 

00 

TSC 2 

LDA DISL.X 

30B4 EO 

02 


LOAD4 

CPX#02 

test for ASCII literal 

3165 

49 

FF 


EOR#FF 

30B6 DO 

14 



BNE L0AD7 


3167 

69 

00 


ADC#00 

30B8 C8 



LOAD 5 

I NY 

ASCII section 

3169 

95 

00 


STA DISL.X 

30B9 A2 

07 



LDX#07 


316B 

E8 



I NX 

30BB B9 

10 

00 


LDA LR,Y 


316c 

88 



DEY 

30BE C9 

22 



CMP#""" 

last character 

3160 

10 

F4 


BPL TSC2 

30C0 FO 

FI 



BEQ LOAD3 


316f 

68 



PLA 

30C2 OA 



L0AD6 

ASL A 

shift char into buff 

3170 

A8 



TAY 

30C3 26 

04 



ROL BUFL 


3171 

60 



RTS 

30C5 26 

05 



ROL BUFH 







30C7 CA 




DEX 


3172 

20 

58 31 

ROR 

JSR TSCB 

30C8 10 

P ! 8 



BPL LOAD6 


3175 

A9 

IF 


LDA# IF 

30CA 30 

EC 



BMI LOAD5 


3177 

25 

04 


AND BUFL 

30CC C8 



LOAD 7 

I NY 

hex.oct and bin 

3179 

85 

04 


STA BUFL 

30CD 20 

97 

31 


JSR LOADT 


317B 

C6 

04 

ROL 

DEC BUFL 

30D0 4C 

AA 

30 


JMP L0AD2 


317D 

A9 

3F 


LDA# 3F 

30D3 25 

22 

4o 

LOAD8+1 

.BYTE 


317? 

25 

04 


AND BUFL 

30D6 24 




.BYTE $ 


3181 

48 



PHA 







3182 

C8 



INY 

30D7 98 



OP 

TYA 

look up command and 

3183 

20 

95 30 


JSR LOAD 

30C8 48 




PHA 

perform 

3186 

68 



PLA 

30D9 AO 

00 



LDY#00 


3187 

AS 



TAY 

30CB A2 

00 



LDX#00 


3188 

A5 

01 

R0L1 

LDA DISH 

3ODD 20 

FO 

30 


JSR 0P1 

match 1st letter 

318A 

OA 



ASL A 

30E0 20 

FO 

30 


JSR 0P1 

match 2nd letter 

318B 

26 

04 


ROL BUFL 

30E3 20 

FO 

30 


JSR 0P1 

match 3rd letter 

3180 

26 

05 


ROL BUFH 

30S6 68 




PLA 


318f 

26 

00 


ROL DISL 

30E? A8 




TAY 


3191 

26 

01 


ROL DISH 

30E8 A9 

31 



LDA#31 

address hi byte 

3193 

88 



DEY 

30EA 48 




PHA 


3194 

10 

F2 


BPL R0L1 

30EB B3 

16 

32 


LDA TABl.X 

address lo byte-1 

3196 

60 



RTS 

30EE 43 




PHA 







30EF 60 




KTS 

jump to operation 

3197 

B9 

10 00 

LOADT 

LDA LR, Y 

30F0 BD 

16 

32 

0P1 

LDA TABl.X 

search table for match 

319A 

85 

OB 


STA SIGN 

30F3 39 

10 

00 


CMP Lh,Y 


319C 

C9 

2D 


CMP#"-" 

30F6 FO 

08 



BEQ 0P2 

match found 

319E 

DO 

01 


BNE LOADT1 

30.-8 E8 




I NX 

next entry 

31A0 

C8 



INY 

30.-9 E8 




I NX 


31A1 

86 

09 

LOADT1 

STX SHIFT 

30rA E8 




I NX 


31A3 

BD 

DO 31 


LDA L0ADT5.X 

30FB E8 




I NX 


31A6 

85 

OA 


STA MASK 

30FC C9 

FF 



CMP#FF 

end of table? 

31A8 

20 

D5'31 


JSR SETZ 

30FE DO 

FO 



BNE 0P1 


31AB 

BQ 

10 00 

L0ADT2 

LDA LR, Y 

3100 E8 



0P2 

I NX 


31AE 

C9 

30 


CMP#30 

3101 C8 




I NY 


31B0 

90 

IE 


BCC LOADT5 

3102 60 




RTS 


31B2 

09 

3A 


CMP#3A 


routines that perform 
operations 


INV address-1 


INV address-1 


two's comp of buff 
two's comp of display 


invert byte 
add 1 


rotate right by rotating 
left 32-n times 


set C to bit 7 of DISH 

shift registers left 
Y times 


Load routine for all 

but ASCII 

test for negative 


# of bits per char 


buff=000000 
ending character 


Page 14 Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 

116 


Number 23 


TINY BASIC FOR COSMAC 

Dear Sir: 

I have read letters in vour magazine (and others) seeking a 
source of basic for the RCA COSMAC CDP 1802 microproces¬ 
sor. Infinite Incorporated offers tiny basic 3K on paper tape, 
listing or cassette tape. Their address is: Infinite Incorporated, 
1924 Waverley Place, Melbourne, FL 32901. 

Yours truly, 

Dana S. Majors 28 La Cienega Way 

Yuba City, CA 95991 


WHIZ’ LOADER/DUMPER 

news release Received: 77 Dec 12 

Shifting Sands Microcomputer Products Corporation has 
begun shipping WHIZ, a software program for recording and 
loading MC6800 based programs on the SWTPC M68 
computer with MIKBUG and the SWTPC AC-30 cassette 
interface. WHIZ operates at nine times the standard MIKBUG 
format 300 baud speed and three times that of the binary 
format. This higher speed capability is provided without any 
modifications to the standard computer or AC-30. Load a 
IK program in 14 seconds, 4K in 48 seconds, and 8K BASIC 
in 85 seconds. WHIZ includes an interactive front-end which 
allows the specification of a header and program start address 
to be placed on tape for read-back later. For $15.95, WHIZ is 
supplied on Kansas City standard cassette in MIKBUG format 
and includes a built-in relocater to place your own copy of 
WHIZ in RAM memory wherever you wish. WHIZ is 
optionally available in 2708 EPROM from Shifting Sands 
Microcomputer Products Corporation, Box 441, Fairborn, OH 
45324. 


DATAFORCE MAINTENANCE SERVICE 
FOR COMPUTER VENDORS 

News Release Received: 77 Sept 1 

A national service organization is seeking the business of 
independent vendors of small business computers including 
computer stores. The general trouble shooting of machines 
in this market has been generally viewed as unprofitable and 
the major drawback to handling the bottom end of small 
computer lines. But the Dataforce Service Company is now 
offering to perform warranty or out of warranty work and 
field service for vendors of small computers and computer 
kits anywhere in the United States. 

Dataforce has 115 service locations in the country and 
is expanding with the goal of having a service outlet within 
50 miles of every computer sold. 

A central diagnostic center is at Dataforce’s headquarters, 
2807-F Oregon Court, Torrance, CA 90503. It opens at 
5 a.m. for trouble calls from the East Coast and reamins 
open until 5 p.m., Monday through Friday. The company 
stresses its desire to help first time computer users with the 
simple problems arising from unfamiliarity with their equip¬ 
ment as well as the sophisticated user who needs a highly 
skilled diagnosis of a computer problem. 

Dataforce is first contacted by calling its Torrance diag¬ 
nostic center. In California the number is (213) 328-2950. 
Outside the state, call (800) 421-1858. A technician qualifies 
the nature of the problem and takes the necessary steps to 
resolve it. When on-site assistance is needed, Dataforce 
dispatches parts and test equipment from the closest service 
organization to the trouble. 

The company is wholly owned by Randal Data Systems, 
Inc., but operates independently. It was created to meet 
the requirements of Randal distributors, outlets for the 
company’s Link 100, Link 200, and Link 500 series, small 
business computers._ 


31B4 90 06 


BCC L0ADT3 

number 

3207 

A5 

02 



LDA dECL move into buffer 

31B6 C9 4? 


CMP*4? 

ending character 

3209 

85 

04 



STA BUFL 

31B8 B0 16 


BCS L0ADT5 


320B 

A5 

03 



LDA DECH 

31BA E9 06 


SBC#06 


320D 

85 

05 



STA BUFH 

31BC 25 0A 

L0ADT3 

AND MASK 

clear unneeded bits 

320F 

A9 

00 



LDA#00 

31BE A6 09 

31C0 06 04 


LDX SHIFT 


3211 

85 

06 



STA BUF0 

L0ADT4 

ASL BUFL 

shift buffer X times 

3213 

68 




PLA 

31C2 26 05 


R0L BUFH 


3214 

A8 




TAY 

31C4 26 06 


R0L BUF0 


3215 

60 




RTS 

31C6 CA 


DEX 








31C? DO F? 


BNE L0ADT4 


3216 

41 

44 

44 

05 

TAB1 consists of 3 ASCII chars and the 

31C9 05 04 


ORA BUFL 

combine new character 

321A 

41 

4E 

44 

OF 

lo byte-1 of the operations add¬ 

31CB 85 04 


STA BUFL 


321E 

42 

49 

4E 

46 

ress. Hi byte * 31. 

31CD C8 


INY 


3222 

44 

45 

43 

52 

31CE DO DB 


BNE L0ADT2 

unconditional 

3226 

45 

4E 

54 

3D 


31D0 60 

L0ADT5 

RTS 


322A 

45 

4f 

52 

16 


31D1 01 00 0? 


.BYTE 01,00,0? 


322E 

48 

45 

58 

4E 


31D4 OF 


.BYTE OF 


3232 

49 

4E 

56 

13 






3236 

4E 

41 

44 

09 


31D5 A9 00 

SETZ 

LDAtfOO 


323A 

4E 

4F 

52 

1A 


31D? F9 06 


BEQ SET 


323E 

4f 

43 

54 

4a 


31D9 A9 99 

SET9 

LDA#99 


3242 

4F 

4f 

52 

20 


31DB DO 02 


BNE SET 


3246 

52 

4C 

7A 


31DD A9 FF 

SETF 

LDA#FF 


324a 

52 

4f 

52 

71 


3IDF 85 04 

SET 

STA BUFL 


324E 

53 

55 

42 

02 


31E1 85 05 


STA BUFH 


3252 

54 

53 

43 

5B 


31E3 85 06 


STA BUF0 


3256 

FF 

FF 

FF 

3c 


31E5 60 


RTS 


325A 

FF 

FF 

FF 

3c 






325E 

FF 

FF 

FF 

3C 


31E6 98 

DECHEX 

TYA 

decimal to binary conv 

3262 

FF 

FF 

FF 

30 


31E7 48 


PHA 

3266 

10 

10 

12 

10 

TAB2+1 consists of lenghts for non dec dis 

31E8 F8 


SED 







31E9 A9 FF 


LDA^FF 


32 6A 

18 



ADD256 

CLC add 256 to buffer 

31EB 85 02 


STA DECL 


326B 

A5 

04 



LDA BUFL 

31ED 85 03 


STA DECH 


326d 

69 

56 



adc^56 

31EF E6 02 

DH1 

INC DECL 


326F 

85 

04 



STA BUFL 

31F1 DO 02 


BNE DH2 


3271 

A5 

05 



LDA BUFH 

31F3 E6 03 


INC DECH 


3273 

69 

02 



ADC#02 

31F5 A2 00 

DH2 

LDX^OO 


3275 

85 

05 



STA BUFH 

31F? A0 02 


LDY#02 


3277 

A5 

06 



LDA BUF0 

31F9 18 


CLC 


3279 

69 

00 



ADC#00 

31FA B5 04 

DH3 

LDA BUFL.X 


327B 

85 

06 



STA BUF0 

31FC E9 00 


SBCffOO 


327D 

60 




RTS 

31FE 95 04 


STA BUFL.X 








3200 E8 


I NX 


327E 

46 

06 


ROTATE 

LSR BUF0 perform rotate rights 

3201 88 


DEY 


3280 

66 

3 



R0R BUFH 

3202 10 F6 


BPL DH3 

keep looping until 

3282 

66 



R0R BUFL 

3204 B0 E9 


BCS DH1 

buffer is 0000 

3284 

6A 




R0R A 

3206 D8 


CLD 


3285 

60 




RTS 

Number 23 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 Page 15 


117 





Status of the UCSD PASCAL Project 


BY KENNETH L. BOWLES 

Director IIS 

This is a brief report on the current status of the UCSD 
PASCAL project intended to answer the questions of the 
hundreds of people who have been writing to us or calling by 
telephone. It is our intention eventually to reach a steady state 
in which we can afford to have full time help capable of 
responding to such inquiries. For the present, we have to 
apologize once again to those who may have been kept too 
long waiting for replies. 

Kenneth L. Bowles 
Institute for Information Systems 
University of California, San Diego 
La Jolla, CA 92093 (714) 452-4526 

Nature of the Project 

The project is one of the principal activities of the Institute 
for Information Systems (IIS). Like other “Organized Research 
Units”, IIS is operated primarily to provide resources and 
activities within which students and faculty can conduct 
research and development projects. Within the range of such 
activities, projects may support instruction and other public 
services though the more usual activities of an ORU involve 
only basic research. 

Under the IIS we have developed a major software system 
for stand-alone microcomputers based on the PASCAL 
language. The initial reason for developing the system was to 
support instruction activities at UCSD. However, the system 
is designed for general purpose use, particularly for the devel¬ 
opment of interactive software, and for software development 
in general. The system has matured sufficiently that we are 
distributing copies to outside users at a $200 fee which pays 
for some of the student part-time assistants who provide 
support to users and maintain the software. Under prevailing 
University policies, we are not attempting to recover capital 
costs from the fees paid by users of our software package. 
However, a number of interested industrial firms have provided 
assistance to further the project through unrestricted grants 
to the Regents of the University of California marked for use 
by our project. These grants are our principal source of oper¬ 
ating funds at the present time. 

Since the PASCAL based software system was developed 
with the intent of supporting long term instructional projects, 
we have placed very high emphasis on machine independence. 
We expect the repertoire of instructional software developed 
to use the underlying system to grow very large. The develop¬ 
ment costs for the instructional software will eventually dwarf 
the costs of the hardware on which it operates. Since the 
industry is introducing new microcomputer designs at a rapid 
rate, we wanted to be able to move the entire software reper¬ 
toire to new machines with a minimum of effort. As will be 
detailed in later sections of this note, our system is now 
running on 5 dis-similar processors, with more planned in the 
relatively near future. We are using the Digital Equipment 
LSI-11 for teaching. Versions for the 8080 and Z80 micro¬ 
processors are operational and will be ready to distribute on 
or about 1 January, 1978. 

We intend to continue promoting the use of our PASCAL- 
based system on as many popular microprocessors as practical 
for two reasons. First, this should provide IIS with a source of 
continuing income to pay for student projects. Second, 
PASCAL with extensions is a superior language for system 


programming, and we believe that it is in the public interest to 
assist in the current effort of many people and institutions to 
promote wider use of PASCAL in place of some of the earlier 
high level languages. Though PASCAL may have some short¬ 
comings for specific applications when compared to specific 
proprietary languages, we regard it as by far the best general 
purpose language now in the public domain. 

Our current Research and Development interests include: 

a. Methods of making large software systems like ours 
more readily transportable to new processor architectures. 

b. The use of microcomputers as intelligent communica¬ 
tions devices to assist humans to work together even when 
located thousands of miles apart. This interest will eventual¬ 
ly involve us in a variety of complex software issues. In the 
near term it will provide us with an efficient method of 
supporting users of our software system who are remote 
from UCSD. 

c. Joint use of microcomputers and Keller’s Personalized 
System of Instruction (PSI) as a means of offering high 
quality college level mass education at lower costs per 
enrolled student than associated with conventional methods. 
A published introductory textbook on problem solving 
using PASCAL, and a library of automated quizzes and 
record keeping software to go with the textbook, are 
available to others as a first step in this direction. 

d. Exploration of possibilities and software problems 
associated with new hardware devices or architectures 
adaptable to the purposes already described. Examples 
include video disks, low cost X-Y input devices, and low 
cost strategies for interconnecting many semi-independent 
microcomputers. 

Partly as a matter of self preservation, we have become 
interested in the problem of standards for the PASCAL 
language. The United States Defense Department and many 
large industrial corporations have recently decided to use 
PASCAL as a base language which they would extend, and 
possibly alter, to create system implementation langauges. 
Although almost every organization has chosen to extend or 
alter in slightly different ways, we have found that the intent 
portrayed in most instances is very similar. In our own imple¬ 
mentation, we too found it necessary to extend PASCAL, and 
in very minor ways to alter the base language as described in 
Niklaus Wirth’s widely read “Report”on the langauge (see 
Jensen, K. and N. Wirth, PASCAL User Manual and Report, 
Springer Verlag, 1975). We, and many others in the PASCAL 
User Group, are very much concerned that all this extension 
and alteration activity will result in PASCAL going the way of 
BASIC for which hundreds of dialects are in common use. We 
believe that a chance still exists to gain consensus on a 
substantial family of PASCAL extensions for system program¬ 
ming, provided that this can be brought about within the next 
6 to 12 months. Unless someone does so before us, we intend 
to convene a summer workshop for representatives of some of 
the major using organizations in the hope that such a consensus 
can be reached. 

Another ancillary activity of the project has been continuing 
search for low cost microcomputer hardware of high quality 
for use in educational institutions — particularly ours. We have 
been advising and collaborating with EDUCOM regarding 
establishment of quantity purchase discounts for stand-alone 
microcomputers. The first microcomputer to be included in 


Page 16 

118 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 23 



the EDUCOM discount program is the Terak Corporation 
8510A, which is based on the Digital Equipment LSI-11. 
For the current market, the Terak unit’s price of $5500 to 
EDUCOM member institutions is highly competitive. Never¬ 
theless, the rate of new announcements from the industry 
continues very high, and we believe that it is all but 
impossible to predict what hardware will provide the best 
cost/performance tradeoff for as long as even one year in 
advance. Of necessity, our search has concentrated on stand¬ 
alone microcomputers with graphic display capabilities, and 
with enough main memory and secondary storage to handle 
the extensive software and course materials with which we 
are working. We welcome inputs on this subject from other 
institutions, or from any vendor, and endeavor to keep 
EDUCOM informed of opportunities that seem advantageous. 
In addition to educational and communications applications, 
we are interested in word processing and business applications 
of the same machines. 

The following sections of this status report contain brief 
detailed summaries covering most of the topics just 
enumerated. If we haven’t answered your questions yet, please 
try again with a phone call or letter. For those who already 
have our software system in use, we will soon be providing 
an automatic Tele-Mail facility on a dial-in basis. This should 
improve dramatically our ability to keep you informed and to 
respond when software difficulties arise. 

The PASCAL based Software System 

Thus far, users who have received our first released system 
have copies of version 1.3, which was completed in mid August 
this year. We have ourselves been using version I.3c since early 
October. By the end of the December academic break, we 
hope to have a version 1.4 available for distribution. The most 
significant generally useful addition since the 1.3 release has 
been the screen-oriented editor. A major package for prepara¬ 
tion of CAI programs, following the general philosophy of the 
University of California Irvine Physics Computer Develop¬ 
ment Project (PCDP), has been placed in operation on the 
Terak 8510A microcomputer. Except for some graphics 
materials within this package, it can be used on a wide variety 
of CRT screen display devices. Software more specifically 
oriented to the Terak machine is also available, and includes 
a character set editor (for the soft character generator), and 
a bookkeeping package for keeping track of student progress 
in a large Keller Plan (TPSI) class. 

The software system is currently executed in a pseudo 
machine interpreter, which emulates a hypothetical real 
machine designed to handle PASCAL constructs efficiently. 
Our pseudo machine is similar in concept to the P-machine 
distributed by Wirth’s group at Zurich, but we have made 
extensive changes to compress the PASCAL object code into 
a much smaller space than possible with the Zurich interpreter. 
The interpreter, and run-time support routines, currently 
occupy about 8K bytes of main memory. The interpreter is 
in the native machine language of the host machine, and thus 
far has been coded by hand using the host’s assembly language. 
All other code in the system is written in extended PASCAL. 

While the interpreted object code runs roughly five times 
slower than native code for the host machine, several factors 
allow our large system programs to run substantially faster 
than this would indicate. The strategy of code compression 
makes it possible to run relatively large programs without time 
consuming overlays. For example, the complete compiler 
occupies 20K bytes in a single overlay. Since the system is 
designed for frequent compile/go cycles associated with 
instruction, we have added several built-in procedures and 
functions to handle low level operations needed frequently 
by the compiler. As a result, the compiler translates PASCAL 


source code at about 650 lines per minute on an LSI-11 with 
its clock set to 2.2 MHz. On a 4 MHz Z80, the compile speed 
will be slightly faster than this. 

Interpreter based versions of our system are now running 
on 5 distinct processors, and two others are close to comple¬ 
tion. Those operating include DEC PDP-1 l’s ranging from the 
LSI-11 to the 11/45, using either floppy disks or RK05 disks 
for secondary storage. Versions for the 8080 and Z80 are 
operating in our laboratory, but more of that later. Sperry 
Univac Minicomputer Operations at Irvine is using the system 
on the V-75 and related machines. Another group at UCSD 
has the system running on the Nanodata QM-1. With support 
from General Automation, a version is close to completion on 
the GA-440 family of machines. National Semiconductor 
has an implementation nearly completed on the PACE micro¬ 
computer. 

The principal modules of the system as it will be distributed 
in the 1.4 release include the following: 

PASCAL compiler 

File manager (capabilities similar to DEC’S PIP) 

Screen oriented editor (cursor positioning, immediate 
updates) 

Line oriented editor (similar to DEC’S RT-11 Editor) 
Debugger (single line execution, reference to variable 
contents) 

SETUP program (adapt system to most ASCII terminals) 
BASIC compiler (ANSI standard plus strings) 

Operating System and user command interpreter 
PASCAL pseudo machine interpreter 
Linker program (for linking independently compiled 
program segments) 

Desk Calculator utility program 

Users of the Terak 8510A may, on request, also receive 
copies of the CAI package, and automated quizzes for the 
introductory textbook, as well as the bookkeeping package. 

Documents describing all of the above are available, and 
part of the release, but not all documents can be considered 
complete at this time. We distribute source and object code 
files on separate floppy disks formatted to be compatible with 
the IBM 3740 standard, with 512 byte blocks laid out in alter¬ 
nate 128 bytes sectors according to DEC’S standard. We have 
occasionally sent copies recorded directly on disk packs for 
the RK05 drives. All other media are painful or impossible 
for us to handle, and no promises are made to use them. Those 
who order the full $200 release package will be sent both the 
documents, and printed lisitings of the source programs. 
Copies of the descriptive documents, amounting to 
approximately 150 pages, may be ordered at $10 each (checks 
payable to the “Regents of the University of California”) to 
cover printing and handling costs. 

Minimum Configuration 

In order to use the compiler, you need a total of at least 
48K bytes of main memory, including the 8K bytes assigned 
to the interpreter. We use 56K bytes. Ideally, the interpreter 
should be completed re-entrant and thus it should be possible 
to operate the interpreter from Read Only Memory. To date, 
the ideal has not quite been achieved, as none of our sponsors 
has yet insisted on that feature. 

At present, the system we use with students contains 
several built-in functions not needed for system development. 
The aggregate size of these functions is large enough to prevent 
compiling the compiler itself, or the operating system, even on 
a 56K byte system. Accordingly, we currently have two ver¬ 
sions of the system, one for students, and one for system 
development. Within the next few months, we plan to add a 
means of configuring general purpose libraries for the system, 
and by that means expect to be able to return to a single 


Number 23 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 17 

119 



version for all purposes. That single version should be practical 
to use in less than 48K bytes for some purposes. 

If you intend to compile on one microcomputer, and to 
execute object routines on others, the others can get by with 
as little as 16K bytes of main memory if the operating system 
is not used. The resident portion of the operating system 
occupies about 8K bytes itself. This will undoubtedly be 
reduced as part of the libraries project. 

The system is designed to be used with standard IBM 
compatible floppy disks. Clearly it can be used with other 
varieties of floppy disks, or with other secondary storage 
media, with appropriate I/O drivers. The I/O drivers have 
proven to be one of our principal bottlenecks, and we make no 
promises in advance about supporting other devices. For 
DEC PDP-11 machines, the floppy disk drivers are assumed to 
be compatible with the RX-11, or with the Terak 8510A 
drives. Hard disks are assumed to be compatible with the 
RK05. 

The system is normally supplied with the assumption that 
the user has a simple line-oriented ASCII terminal. The 
SETUP program can be used to configure control codes for 
more appropriate use of most CRT terminals. Copies of the 
system supplied to users of the Terak 8510A make fairly 
extensive use of the special graphics and character generator 
facilities of that machine. 

8080 and Z80 Versions 

The Z80 version is now running on the Tektronix 8002 
Microprocessor Development Aid system, for which Tektronix 
has supplied substantial support to the project. The 8080 
version uses virtually the same source code as is used on the 
Z80, with conditional assembly altering certain passages in the 
source to substitute for a few of the extended Z80 instructions 
that proved useful. 

Release of the 8080/Z80 version of the system of other 
machines has been held up primarily because of the awkward¬ 
ness of handling I/O. We currently have a Zilog Development 
System, a Processor Technology SOL system, and a Computer 
Power and Light COMPAL-80 system. The floppy disk pro¬ 
visions for each of these machines is non-standard. As a result, 
we have been forced to down-load programs via serial inter¬ 
faces to get from the LSI-11 host machines used for develop¬ 
ment over to the new 8080 or Z80 based host. This has proven 
to be a very time consuming process, and a serious bottleneck 
in our work. Moreover, we are somewhat amazed to find that 
the assembly of large programs on these machines runs almost 
a factor of ten slower than compilation of PASCAL programs 
that carry out similar tasks! Clearly, something has to give if 
we are to reach the objective of distributing PASCAL systems 
for more than a few 8080 and Z80 based machines. 

The solution to this problem that we now plan to use is 
based on the extensive market penetration of an operating 
system called CP/M, which is a product of Digital Research 
Inc. We have talked with many OEM and hobbyist users of the 
8080 and Z80 who wanted to know when we would have the 
PASCAL system operating under CP/M. We then learned that 
CP/M is distributed in a package which assumes that most 
users will write their own I/O drivers. In effect, CP/M estab¬ 
lishes a quasi standard for the interface between an 8080/Z80 
operating system and its I/O drivers. With thousands of copies 
working in the field, CP/M seems to be far ahead of the field 
in this area. Accordingly, we have decided to release the UCSD 
PASCAL System for 8080 and Z80 users in a form that will 
work with I/O drivers and bootstrap loaders developed for use 
with CP/M. This does not mean that our package will run 
under CP/M. However, if CP/M runs on your machine it should 
be relatively easy to install the PASCAL system on that 
machine. We have been in contact with Digital Research on 


this concept, and they have offered to cooperate. If you do 
not have CP/M for your machine, the implementation package 
may be obtained from Digital Research Inc., Box 579, Pacific 
Grove, CA 93950 for $70. Since CP/M has been implemented 
on a very wide variety of 8080 and Z80 based machines, there 
is a high probability that CP/M I/O drivers are already available 
from Digital Research or someone else for your machine. 

Alteration of our present interpreter to match the CP/M 
I/O calling conventions has proven to be very simple, at least 
on paper. We expect that some implementors of CP/M will 
have installed standard console input routines which auto¬ 
matically echo to the standard console printer or display 
device. This will necessitate a change, since our system uses 
both echoing and non-echoing console input. At this writing, 
the exact method to be used is under discussion. Barring some 
unforseen calamity, copies of our system designed to run with 
CP/M I/O drivers should be ready for distribution by early 
January, 1978. The distribution medium will be IBM compa¬ 
tible floppy disks formatted in a manner yet to be finally 
specified. We will undertake to transform the system for other 
media and other formats, in general, only if a copy of the 
necessary hardware is available in our laboratory, and only if 
funds are available to pay for the extra conversion work. 

For many of the 8080 based machines we have seen, the 
most practical way to install our system will be to use 48K 
bytes of RAM augmented with 8K bytes of ROM for the 
interpreter. Any additional RAM or ROM required by the 
host processor system will also be needed. 

PASCAL Extensions and Alterations 

We have attempted to implement faithfully as much as 
possible of PASCAL as defined in Jensen & Wirth’s User 
Manual and Report. The principal extensions to PASCAL 
embodied in our system are related to STRING variables, 
Turtle Graphics, handling of disk files, Segment (overlay) 
Procedures, and several functions for support of the system 
itself. Alterations include a prohibition against passing pro¬ 
cedure, the addition of EXIT (<procedurename>) to effect 
a normal exit from the procedure named in the parameter, and 
a change in READ applying to the interactive INPUT and 
KEYBOARD files. Further details than given in this section 
are given in our system release documents. 

Type STRING is a pre-declared record containing a 
character count followed by a packed array of characters. 
Built-in procedures and functions include LENGTH, 
POS(ition), INSERT, DELETE, COPY (i.e. extract), 
CONCATenate, SCAN, FILLCHAR, MOVERIGHT, and 
MOVELEFT. The last four of these also operate on conven¬ 
tional packed arrays of characters. 

Turtle Graphics describes a technique originated by 
Seymour Papert of MIT in which one can either MOVE a 
cursor (called the “turtle”) an arbitrary number of screen 
units in the current pointing direction, or TURN an arbitrary 
number of degrees at the current position. A PENCOLOR 
procedure allows the line drawn by a MOVE to be either 
WHITE, BLACK, or NONE. 

The disk file extensions allow working with fixed length 
logical records corresponding to any legal <type>, which 
might typically be a RECORD data structure. GET and PUT 
operate normally through a window variable of the same 
<type>. OPENNEW creates a new file, OPENOLD opens a 
pre-existing file, and CLOSE allows saving or purging a file. 
SEEK (which will be distributed with the 1.4 system for the 
first time) allows random access to logical records within a file. 

SEGMENT Procedures are separately compiled and then 
linked into the host program using the LINKER. A Segment 
procedure is only loaded into main memory when it is 
entered for the first time, and its memory space is deallocated 


Page 18 

120 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 23 



upon exit from the first invocation. 

READ(INPUT , X) is defined by Wirth as X: =INPUTt; 
GET(INPUT); which we find to be extremely awkward for 
interactive use. Our solution is to place the implied GET 
before the implied assignment in the case of interactive files 
of type TEXT. READ operates as defined in Wirth’s Report 
for other TEXT files. 

PACKED records on our system which fit within 16 bit 
fields are automatically packed and unpacked without 
explicit action by the programmer. 

Introductory PASCAL Course and Textbook 

Many of those inquiring about our system have heard about 
it through having seen the textbook “Microcomputer Problem 
Solving Using PASCAL” by the author of this note, published 
this fall by Springer Verlag. If you haven’t seen a copy, they 
may be obtained from Springer at 175 Fifth Ave., New York 
City, NY 10010. 

The book is the basis for teaching the large attendance 
introductory computer science course at UCSD. This course 
comes close to matching the specifications for course CS1 in 
the recently published curriculum recommendations from 
ACM’s SIGCSE. The approach is non-numerical as far as 
practical, as a tactic to reach the many students who come to 
us with inadequate preparation in high school mathematics. 
The problem solving and programming approach taught is 
the same as we would teach even if all the problem sets were 
mathematics oriented. Because many problem examples and 
illustrations use our string and graphics extensions to PASCAL, 
the textbook currently assumes that the student will have 
access to a computer which mns under the UCSD PASCAL 
system. We will be glad to discuss the possibility of conversion 
to other software systems, but have very limited resources to 
apply to such conversions. There are several stand-alone 
microcomputers now being sold in large quantities on which 
our system would run, given a small conversion effort, and we 
would welcome support funds to pay for such conversions. 

Software in the form of automated quizzes is available with 
our system release for those who may wish to teach using the 
textbook. Each chapter in the book has a list of study goals 
for the students to achieve. Wherever appropriate, the quizzes 
test for mastery of the topics enumerated in the goals lists. 
The quiz programs have been implemented using a set of 
CAI primitive routines patterned after the well known 
DIALOG CAI system developed at U.C. Irvine by Alfred Bork 
and his colleagues. 

The introductory course is taught using Keller’s Personal¬ 
ized System of Instruction (PSI). PSI has been found to be a 
more successful method of instruction than any other method 
commonly used in universities and colleges. This success is 
achieved, almost completely without conventional lectures, by 
using experienced students as Learning Assistants called 
“proctors”. The characteristics of this method make us believe 
that it is possible to offer this course, or others constructed 
along the same lines, on a packaged basis for use at other 
institutions. A separate paper describing this possibility in 
detail called “Microcomputer Based Mass Education” is 
available from the writer of this status report. 

Tele-Mail User Support Facility 

We have reached the point where it will be possible for us 
to begin operating a dial-in computer “mailbox” by early in 
the winter quarter. We have been using the Terak 8510A 
machines occasionally as intelligent terminals for exchanging 
messages via the large B6700 computer operated by the 
campus computer center. Our own Tele-Mail facility will use 
its own single telephone number reachable directly from the 


national dialed telephone network, or internally via the 
California state government telephone network. Mail sub¬ 
scribers to our software release will be notified when this 
mailbox facility is ready to be used. 

The mailbox will be operated primarily to serve users of 
our software system. It will provide notices of recent bug 
corrections, down-loading of program files (either source or 
object) where appropriate, notices on new additions to the 
software and new machines on which implementations have 
been completed, and other useful information from us to the 
users. It will also serve as a means for us to collect messages 
from specific users, and to answer them expeditiously, without 
the hassle of both parties having to be at their telephones at 
the same time. 

Through the use of block transfer software, the mailbox 
will make relatively efficient use of the dialed telephone net¬ 
work. We would like to begin immediately by offering a dial- 
in port at 1200 bits per second. However, the present state of 
confusion in the industry at that speed (which is the fastest 
one can use with acoustic couplers) leads us to move 
cautiously. We can and will install a port at 300 bits per 
second using the standard Bell 103A equivalent conventions. 
The system will answer an incoming call from an ordinary 
terminal by providing a brief summary of recent developments. 
It will otherwise expect a “handshake” from a special file 
transfer program that we will provide to users of our software 
package. This program will be the means of interchange based 
on efficient transfer of messages in the form of complete files. 
If you wish to send an ordinary text massage to us, you will 
prepare the message using either of the editors built into the 
system. Only after the massage is complete will you need to 
make the telephone connection. 

Forthcoming Improvements 

As mentioned earlier, our next significant improvement in 
the software will be a more flexible system allowing libraries 
of programs. One of the main reasons for doing this will be to 
allow the software to be configured to make efficient use of 
main memory in cases where the user does not need all of the 
built-in facilities. For example, we have no need for turtle 
graphics when compiling large system programs. 

One of the long awaited features of the new library system 
will be an arrangement allowing mixture of PASCAL proce¬ 
dures with Assembly language routines and/or procedures 
compiled directly to the native code of the host machine. 
The necessary assemblers and code generation will come some¬ 
what after the library system is operational. If all goes well, 
the library system should be ready to distribute during the 
winter quarter of 1978. The assemblers and native code 
versions of the compiler will come somewhat later as time for 
the necessary work permits. 

Many people have asked whether we have in mind exten¬ 
sions to support Concurrent PASCAL, or similar facilities to 
allow independent processes running concurrently. This is 
something we would like to do eventually, but our current 
resources do not allow making definite plans in this area. 


ADCIS MET IN DALLAS 

News Release Received: 78 Jan 9 

The 1978 Winter Meeting of the Association for the Devel¬ 
opment of Computer-based Instructional Systems (ADCIS) 
was held in Dallas, Texas, March 1-4, 1978. For further 
information, contact the conference host, Carol Luce, Educa¬ 
tional Service Center, Region 100,400, East Spring Valley Rd, 
Richardson, TX 75080, (214) 231-6301. 


Number 23 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 19 

121 



ACT 

An 8080 Macroprocessor 


BY ALEX CECIL 

Lawrence Livermore Laboratory 

ACT is a macro text interpreter which runs under the CP/M 
operating system on an Intel 8080 compatable microcomputer. 
More than 16K bytes of RAM are needed. ACT uses the same 
algorithm as TRAC [2] (“TRAC” is a registered trademark of 
Rockford Research Institute) and a set of primitive functions 
which are similar to those in the TRIX interpreter [ 1 ]. ACT 
also uses the special characters @ (J } in place of TRAC’s 
#(,). ACT has been used to control jobs on a large time shar¬ 
ing system and to format diskette files; it is generally too slow 
for efficient human interaction. 

Logically (but not necessarily psychologically), the syntax 
is very simple. Program and data are character strings which 
are handled by the same rules. There are three structures: 

M 

@ (op Iarg 1 I arg2 |... | argn j 
(® @{op | arg 1 | arg2 |.. . | argn } 

The first is a literal quote; the contents are passed on as the 
value. The second performs the indicated operation on the 
argument strings and immediately rescans the resulting value. 
The last form performs the operation and passes the value to 
the next higher level function. Any op or argument may have 
any of the three forms. For more information on the scanning 
algorithm see any of the published descriptions of TRAC. 

There is a version of ACT which uses upper case letters for 
the command names and the special characters A [.,] ' instead 
of @{| } . Also, the meta-character is the exclaim (!). 

Execute line 

act 

act < file-name > 

act < file -name > < options > 

If a file name is given, then the ACT macros in the file are 
read first; < file-name > has the general form “d:x.y”. The 
string @ in is initialized to the characters between “act” and 
the return. 

As a special case, <options> may be the three characters 
nh, where A is the caret (or up arrow), and hh is a hex page 
number. Free storage is allocated from the end of the inter¬ 
preter up to, but not including, page hh or FBASE if A hh is 
not given. 

Non-disk I/O and debug 

@ {re|prompt] “read string” 

Value is a line of input from the console (via CP/M call 
#10), or the next string from the input file. Line-feed, 
return, and tab characters from the input file are ignored; a 
string is terminated by the meta-character (~) or by the 
end-of-file. Comments on the input file are enclosed 
within matching left quotes ( N ). Input files generally do 
not end with the meta-character. 


@(ps | a | a |.. .^ “print string” 

Each argument (after the “ps”) is printed on a separate line; 
but there is no CR-LF after the last argument. 

<® (so | message] “send to Octopus” 

The message is sent over the selected Octopus channel. 
Usually the message does not end with an Octopus end- 
message character. The echo is lost. (Note: “Octopus” is 
the name of the LLL time sharing system. The so and ro 
functions talk to Octopus over a serial interface as an ordin¬ 
ary terminal. Separate documentation illustrates how this 
hardware dependent function can be patched for different 
I/O ports.) 

@ (ro | x | s 111 eom] “read Octopus” 

If the Octopus time-out is greater than zero, then a mes¬ 
sage terminator is sent. This terminator either causes a 
previous “so” message to be delivered or a log-out in case 
there was no previous “so” and the terminator is a 
control-D. Octopus output is then collected in the string 
@ro until the string X is encountered or until the time-out 
interval passes since the last character. The value is s if x 
was found, otherwise f. If s and f are omitted, the value is 
null. (Note this inconsistency with the functions gc and in.) 
A null x will always fail to match. 

A non-null last argument (eom) will change the Octopus 
message terminator. The argument eom must be the two 
hex characters which correspond to the terminator. The 
terminator is initially a control-D. 

@ fio | x | x |...] “input-output parameters” 

Each argument x is a letter (o, t, m) followed by an 
associated parameter: 

oa selects Octopus channel a. (initial value) 
ob selects Octopus channel b. 

tn sets the Octopus time-out to n seconds. E. g. 1120. 
me redefines the meta-character to be the character c. 
p print: terminal output is thru CP/M, “fw” applies, 
d display: direct output, “fw” does not apply. 

Note: This option is hardware dependent. 

@ {fw |n ] “form width” 

The “print string” function will start a new line after n 
characters. The initial form width is 80. However, this does 
not apply if an @ {io | p ] is in effect. 

@{tn] “trace on” 

Turn the trace mode on and save the previous mode. Note: 
An @ {io|dj is implicitly given so that the output will 
wrap around; see the fw function above. 

@ (tf ] “trace off’ 

Restore the previous trace mode, up to eight levels. 

(® { nb J “number of blocks” 

Value is the number of sixteen word free storage blocks. 
@{fs|n|m] “free storage” 

Free storage is augmented by the memory locations n up 
to but not including m; n and m are decimal and must be 
multiples of 16. 

@[vn] “version number” 

Value is the ACT version number. 


Page 20 

122 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 23 



Disc I/O 


The file name has the general form “d:x.y”. If d is omitted, 
the system drive is selected; lower case characters in the 
name are mapped to upper case. The number of the next 
record to read or write is set to n. (Records are numbered 
sequentially starting at zero; each record consists of 128 
characters.) If the open fails the value is f; otherwise the 
value is s. 

Since only one file can be open at a time, the record 
number of the current file may need to be saved by @ [rn}. 
Also, a currently opened output file must be closed before 
another open. 

@{mf| file-name Is |f J “make file” 

If the named file can be created, the value is s; otherwise 
the value is f. The current record number is set to zero. 

@ [cf | s | f ] “close file” 

The currently opened file is closed. The value is f if there is 
a close error, otherwise s. 

@ [df [ “destroy file” 

The current file is destroyed. 

@ (rn [ “record number” 

The value is the record number of the next record to read 
or write. This number applies to the currently opened file. 
@ { wf | string-name | x | s | f ^ “write file” 

Characters from the named string, starting with the first, 
are written to the currently opened file. If x is null, then 
the last partial record is not written; instead, the form 
pointer of the named string is left positioned at the remain¬ 
der. For example, the output for the next write could be 
constructed by: . -i 

@ { ns | name | @@ [in |name | <more output> j . 

If x is non-null, then the first character of x is used to 
pad out the remainder of the record and the record is writ¬ 
ten. An entire record of pad characters is written if the 
previous output ended on a record boundary. 

The value is f if there is a write error, otherwise s. 

@ (rf | string-name | m | s | f J “read file” 

The next m records are read from the currently opened 
file and appended to the named string. The value is f if the 
physical end of file is reached, otherwise s. 

@frdj “read dialect” 

The value is the text from the currently open file. The file 
is read starting with the record set by the open file. The 
input is processed in the same manner as described for the 
rs function. Thus, one program can load another in the 
same way as is done when a file name is put on the execute 
line after “act”. Warning: No of or mf commands can be 
executed until the file has been read. 

Control and delay 

<®[eq|a|b|s|b|s|...|b|s] or @ [eq|a|b|s|b|s|... 

1 f [“equal” 

The value is the first s for which the preceding b is equal 
to a, where “equal” means string equality. If the last argu¬ 
ment is not one of a “b-s” pair, then it provides an “else” 
value. . 

@[ge|n|m|s|f] “greater than or equal to” 

The value is s if n is numerically greater than or equal to m, 
otherwise the value is f. 

@ [nt | name | s | f} “null test” 

The value is s if the named string is null, otherwise the value 
isf. 

@ (ex 1 x J “exit” 

Clear the active and neutral strings; then set the active 
string to x. 


@ (st | “stop” 

Return to CP/M. 

@[zz|n[ “sleep” 

Sleep for n/10 seconds. 

String ops and hex-to-characters 

@ {ns | name j value | name | value |. .. ] “name string” 

Create one or more strings with the given values. 

@ [as | name | x | name | x |...] “append string” 

Append the string x to the named string. 

@ [ss |name | arg | arg |...]• “segment strong” 

Create arguments in the named string. 

@ Id |name | arg | arg |... J or @ [name | arg| arg | . . .} “call” 
Return the named string, starting at the first character, with 
the actual arguments substituted for those corresponding 
substrings which were matched by a previous “segment 
string”. 

@ [gc | name | n | s | f ) “get characters” (4 or more arguments) 
Move the form pointer over n characters, or to the end of 
the form if there are fewer than n characters remaining. The 
characters passed over are put into the string “@gc”. 
Return s if there are n characters after the form pointer in 
the named string, otherwise return f. 

@ j gc | name | n } “get characters” (3 arguments) 

Like gc with 4 or more arguments except that the value of 
@gc is also the value of this function. 

@ [gc | name] 

Return the total number of characters in the named form. 

@ [in | name | p | s | f J “initial” (4 or more arguments) 

Starting at the form pointer, search for the substring p. 
The characters which are passed over in the search, up to 
but not including p, are put into the string “@in”. If p is 
found return s, otherwise return f. The form pointer is left 
positioned after s, or at the end of the form. Null p always 
fails. 

@[ in | name | p j “initial” (3 arguments) 

Like in with 4 or more arguments except that the value of 
@in is also the value of this function. 

@[ in | name [ “initial” (2 arguments) 

Return the characters from the form pointer to the end of 
the form; also set @in to this value. The form pointer is left 
past the end of the form. 

@ [cr | name j “call restore” 

Move the form pointer of the named string to the beginning 
of the string. 

@ [dd | name | name |... J “delete definitions” 

Delete the named strings. 

@ fpk|hex ] “pack” 

Return the characters whose hex values are given. 


@[uk|xj “unpack 
Return the hex 


Arithmetic 


form of the string x. 


@[ad|n |n|..“add” 

Return the sum of the arguments. Numbers are represented 
by signed decimal integers whose magnitude is less than 
32768 

@{su|n|m[ “subtract” 

Return n-m. 

@ [ml | n | n |.. .] “multiply” 

Return the product of the arguments. 

@[dv|n|m] “divide” 

Return n/m. 

@\md|n|m[ “mod” 

Return n mod m. 


Number 23 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 21 

123 


Special Strings 


@ cb “console break” 

The value of this string is the last console break character. 

@ im “idle macro” 

This macro is loaded whenever the active string is empty. 
The initial value of @im is @ £ps| @ ^ rs | .11 , but @im may 
be changed at any time. 

Console “break” 

The last character of any console input, other than for the 
@ rs function, is saved in the string @cb. Moreover, if the 
input character is an ESC, then you will be prompted to type 
one of the letters t, n or i which will turn the trace on (t), 
turn the trace off (n), or reload the idle macro (i). Console 
input will stop output, or cause an immediate return from the 
zz or ro functions. 

Generating a COM File with a Preloaded ACT Program 

A COM file containing the ACT interpreter and a preloaded 
macro file may be created as follows, assuming a 32K system. 

1. Append something like the following to your macro file 
@fnsl@im|J 

@ [fs 126368129184} 

@fns|@im|(@[ps|@\rs|. 

@s start"! 

]) 

@ st 

where “start” is the name of your top level macro. Note 
that the fs function adds 6700 hex up to 7200 hex to the 
free storage list after the program is started (step 4). Free 
storage normally extends to FBASE which is 7200 hex in 
a 32K system. 

2. Load your program by typing 

act macro-file *6 7 

where ” is the caret, or up arrow. Free storage will 
extend up to 6700 hex; if your program needs more space, 
then you need more than 32K to make a COM file. TTie st 
function at the end of your file will return control to CP/M. 


3. Make a COM file with the SAVE command 

save 103 code.com 

4. Run the code by typing either of the following 

code 

code options 

The options will be in the string @in. 

Error Messages 

DISK EOF: The rs function is trying to read beyond the end 
of file. 

FREE STORAGE IS EMPTY: The combined storage required 
for named strings, string names, and active and neutral 
strings has exceeded the allocated memory. At this point, 
the active and neutral strings are cleared and control given 
to the @im macro. The second time this happens, control 
returns to CP/M. 

NS STACK OVERFLOW: The number of unprocessed 

arguments exceeds 250. The level of nesting or the number 
of arguments is excessive. For example, the number of 
arguments for a ns should not get much over 200. 

References 

1. Moll, H., "TRIX — An interactive, interpretive language for manipu¬ 
lating strings of characters." Lawrence Livermore Lab Report 
UCID-30100. 

2. Moors, C. N., "TRAC, a Procedure describing Language for the 
Reactive Typewriter." Comm. ACM9, 3 (March, 1966) 

3. Moors, C. N., "TRAC, A Text Handling Language." Proc. ACM 
20th Nat. Conf., Cleveland, August, 1965. 

4. Wegner, Peter, Programming Languages, Information Structures, 
and Machine Organization. McGraw-Hill Book Co., 1968. 


Note: Since the listing of ACT is quite long, we are publishing 
the PL/M listing only in this issue. In the next issue we will 
print the symbol table and assembler listing along with a table 
referencing selected line numbers from the PL/M version 
to the assembler listing - TR W. 


4 


8080 PLM1 VERS 3.0 

00001 1 /* STANDARD LANGUAGE EXTENSIONS. 6/16/75 */ 

00002 1 DECLARE 

00003 1 TRUE LITERALLY 'OFFH', 

00004 1 FALSE LITERALLY 'O', 

00005 1 FOREVER LITERALLY 'WHILE TRUE', 

00006 1 FOR LITERALLY 'DO', 

00007 1 ENDFOR LITERALLY 'END;', 

00008 1 FI LITERALLY 'END:' 

00009 1 SELECT LITERALLY 'DO CASE', 

00010 1 OF LITERALLY ';', 

00011 1 ENDSELECT LITERALLY 'END;', 

00012 1 FUNCTION LITERALLY 'PROCEDURE', 

00013 1 ENDFUNCTI ON LITERALLY 'END', 

00014 1 ENDPROCEDURE LITERALLY 'END'. 

00015 1 ENDDO LITERALLY 'END; 1 , 

00016 1 BEGIN LITERALLY 'DO;'; 

00017 1 

00018 1 100H: START: 

00019 1 /* ACT VERSION 31 10/17/77 */ 

00020 1 /* DON'T FORGET TO CHANGE PFSVN */ 

00021 1 

00022 1 /* TO CHANGE TO UPPER CASE FOR TTY MOD33: 

00023 1 1. CHANGE SPECIAL ACT CHARACTERS, 

00024 1 2. CHANGE ALPHABET (LITSA ETC.), 

00025 1 3. CHANGE PFSLIST. 

00026 1 4. CHANGE METASCHAR TO APOSTROPHE. 

00027 1 */ 

00028 1 

00029 1 



Page 22 

124 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 23 


i 





00030 1 

00031 1 

00032 1 

00033 1 

00034 1 

00035 1 

00036 1 

00037 1 

00038 1 

00039 1 

00040 1 

00041 1 

00042 1 

00043 1 

00044 1 

00045 1 

00046 1 

00047 1 

00048 1 

00049 1 

00050 1 

00051 1 

00052 1 

00053 1 

00054 1 

00055 1 

00056 1 

00057 1 

00058 1 

00059 1 

00060 1 
00061 1 
00062 1 
00063 1 

00064 1 

00065 1 

00066 1 
00067 1 

00068 1 
00069 1 

00070 1 

00071 1 

00072 1 

00073 1 

00074 1 

00075 1 

00076 1 

00077 1 

00078 1 

00079 1 

00080 1 
00081 1 
00082 1 
00083 1 

00084 1 

00085 1 

00086 1 
00087 1 

00088 1 
00089 1 

00090 1 

00091 1 

00092 1 

00093 1 

00094 1 

00095 1 

00096 1 

00097 1 

00098 1 

00099 1 

00100 1 
00101 1 
00102 1 
00103 1 

00104 1 

00105 1 

00106 1 
00107 1 

00108 1 
00109 1 

00110 1 
00111 1 
00112 1 


Number 23 


/*** SPECIAL CHARACTERS ***/ 

DECLARE /* CONTROL CHARACTERS */ 

NUL LITERALLY '00H', 

SOH LITERALLY '01H', /* CONTROL-A */ 

ETX LITERALLY '03H', /* CONTROL-C */ 

EOT LITERALLY '04H', /* CONTROL-D */ 

ENQ LITERALLY '05H', /* C0NTR0L-E #/ 

BEL LITERALLY '07H', 

HT LITERALLY '09H', 

LF LITERALLY 'OAH', 

VT LITERALLY 'OBH', 

CR LITERALLY 'ODH', 

50 LITERALLY 'OEH', /* CONTROL N */ 

51 LITERALLY 'OFH', /* CONTROL 0 */ 

DC3 LITERALLY '13H', 

NAK LITERALLY '15H', /* CONTROL-U */ 

SYN LITERALLY '16H', 

ETB LITERALLY '17H', /* CONTROL-W */ 

CAN LITERALLY '18H', /* CONTROL-X */ 

EM LITERALLY '19H', /* CONTROL-Y */ 

SUB LITERALLY '1 AH', /* CONTROL-Z */ 

ESC LITERALLY '1BH', 

DEL LITERALLY '7FH', 

PHI LITERALLY '80H', /* MARKS AN UNUSED CHAR. POSITION */ 

NIL LITERALLY '81H'; /* MARKS THE END OF A STRING, SEE NILNIL IN FSSGET */ 

DECLARE /* SPECIAL ACT CHARACTERS */ 

FUNSCH LITERALLY '40H', /* 'AT' CHARACTER (OR UP-ARROW) */ 

LEFTSDELIM LITERALLY '7BH', /* LEFT BRACE (OR SQUARE BRACKET) */ 

ARGSDELIM LITERALLY '7CH', /* BAR (OR COMMA) */ 

RIGHTSDELIM LITERALLY '7DH', /* RIGHT BRACE (OR SQUARE BRACKET) */ 

COMMSDELIM LITERALLY '60H'; /* GRAVE ACCENT (OR APOSTROPHE) */ 

DECLARE /* ALPHABET (EITHER LOWER OR UPPER CASE) */ 

LITSA LITERALLY '61H', 

L1T$B LITERALLY '62H', 

LITSC LITERALLY '63H', 

LITSD LITERALLY '64H', 

LITSE LITERALLY '65H', 

LIT*F LITERALLY '66H', 

LITSG LITERALLY '67H', 

LITSH LITERALLY '68H', 

LIT#I LITERALLY '69H', 

LIT#J LITERALLY '6AH', 

LITSK LITERALLY '6BH', 

LITSL LITERALLY '6CH', 

LIT$M LITERALLY '6DH', 

LIT*N LITERALLY '6EH', 

LIT#0 LITERALLY '6FH', 

LITSP LITERALLY '70H' , 

LITSQ LITERALLY '71H', 

LIT$R LITERALLY '72H', 

LITSS LITERALLY '73H', 

LIT#T LITERALLY '74H', 

LITSU LITERALLY '75H', 

LIT$V LITERALLY '76H', 

LIT$W LITERALLY '77H'. 

LIT$X LITERALLY '78H', 

LITSY LITERALLY '79H', 

LITSZ LITERALLY '7AH'; 


/*** DATA WHICH MUST BE LOCATED MOD 16 ***/ 

DECLARE /* THIS MUST BE THE FIRST NON-LITERAL DECLARE */ 

ATSGC DATA (0,0,FUNSCH,LIT$G,LITSC,NIL,0,0,0,0), /* 106-10F */ 

AT#IN DATA (0,0,FUNSCH,LITSI,LITSN,NIL). /* 110-115 */ 

AT$R0 DATA (0,0,FUNSCH,LITSR,LITSO,NIL,0,0,0,0), /* 116-11F */ 

ATSCB DATA (0,0,FUNSCH,LITSC,LITSB,NIL); /* 120-125 */ 


/#** BASIC I/O, SYSTEM CALLS ***/ 

DECLARE /* I/O READY TESTS FOR CONSOLE */ 

/* 'IN' REFERS TO TERM INAL-TO-OCTOPUS DIRECTION */ 
/* 'OUT' REFERS TO OCTOPUS-TO-TERMINAL DIRECTION */ 
CPMSPRINTSFLAG BYTE INITIAL (TRUE), 

TERMSSTATUS LITERALLY '1', /* HARDWARE */ 
TERMSDATA LITERALLY 'O' /* HARDWARE */ 

TERMSINSREADY LITERALLY 'M0N2(11,0)', 

TERMSOUTSREADY LITERALLY 'ROR(M0N2(11,0),2)'j 





Or. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 23 


125 



00113 1 DECLARE 

00114 1 (CONSWIDTH, CONSCOLUMN) BYTE INITIAL <80.0), 

00115 1 CONSIN BYTE INITIAL (TRUE), /* CONSOLE INPUT (DISK INPUT IF FALSE) */ 

00116 1 CONBUF(82) BYTE INITIAL (80,0,1). 

00117 1 OCTOSTIMEOUT ADDRESS INITIAL (120), 

00118 1 TFCBSPTR ADDRESS INITIAL (5CH), /* TRANSIENT FILE CONTROL BLOCK */ 

00119 1 TFCB BASED TFCBSPTR BYTE, 

00120 1 TBUFFSPTR ADDRESS INITIAL (80H), /* TRANSIENT FILE BUFFER */ 

00121 1 TBUFF BASED TBUFFSPTR BYTE, 

00122 1 TBUFFSINDEX BYTE INITIAL (128), 

00123 1 ENDSOFSFILE LITERALLY 'SUB', 

00124 1 0CTOSE0M BYTE INITIAL (EOT), 

00125 1 METASCHAR BYTE INITIAL (7EH), /* TILDA OR EXCLAIM */ 

00126 1 PRELOADED BYTE INITIAL (FALSE), 

00127 1 (DEFAULTSDRIVE,PREVIOUSSDRIVE,CURRENTSDR IVE) BYTE; 

00128 1 

00129 1 DECLARE /* SOME GENERAL PURPOSE TEMPS */ 

00130 1 TEMPSPTR ADDRESS, 

00131 1 DUMMY BYTE, 

00132 1 I TEMP BYTE; 

00133 1 

00134 1 

00135 1 /*** BASIC I/O ***/ 

00136 1 

00137 1 DECLARE 

00138 1 BDOS LITERALLY '5H' , 

00139 1 FBASEA ADDRESS INITIAL (6H), 

00140 1 FBASE BASED FBASEA ADDRESS, 

00141 1 EXIT LITERALLY 'CALL M0N1(0,0)'; 

00142 1 

00143 1 M0N1: PROCEDURE(F,A); 

00144 2 DECLARE F BYTE, A ADDRESS; 

00145 2 GO TO BDOS: 

00146 2 ENDPROCEDURE M0N1; 

00147 1 

00148 1 M0N2: FUNCTI ON(F,A) BYTE: 

00149 2 DECLARE F BYTE, A ADDRESS; 

00150 2 GO TO BDOS; 

00151 2 ENDFUNCTION M0N2; 

00152 1 

00153 1 CRLF: PROCEDURE; 

00154 2 CALL M0N1(2,CR); 

00155 2 CALL M0N1(2,LF); 

00156 2 C0N$C0LUMN=0; 

00157 2 ENDPROCEDURE CRLF; 

00158 1 

00159 1 PRINTSCH: PROCEDURE(CH); 

00160 2 DECLARE CH BYTE; 

00161 2 CALL M0N1(2,CH); 

00162 2 IF CH = CR THEN DO; C0N$C0LUMN=0; FI 

00163 2 /* NOTE... SHOULD HANDLE NON-GRAPHIC CHARACTERS */ 

00164 2 IF (CONSCOLUMN:=CONSCOLUMN+1) = CONSWIDTH THEN DO; 

00165 2 CALL CRLF; 

00166 3 FI 

00167 2 ENDPROCEDURE PRINTSCH; 

00168 1 

00169 1 DISPLAYSCH: PROCEDURE(CH); 

00170 2 /* SEND A CHAR TO TERMINAL. NOTE: HARDWARE DEPENDENT */ 

00171 2 DECLARE CH BYTE; 

00172 2 DO WHILE ROR(INPUT(TERMSSTATUS),2); ENDDO 

00173 2 OUTPUTCTERMSDATA)=NOT CH; 

00174 2 END DISPLAYSCH; 

00175 1 

00176 1 READSCH: FUNCTION BYTE; 

00177 2 RETURN M0N2(1,0): 

00178 2 ENDFUNCTI ON READSCH; 

00179 1 

00180 1 CONSBREAK: FUNCTION BYTE; 

00181 2 RETURN M0N2(11,0); 

00182 2 ENDFUNCTION CONSBREAK; 

00183 1 

00184 1 PRINTSMESS: PROCEDURE(MESSSPTR); 

00185 2 DECLARE MESSSPTR ADDRESS; 

00186 2 CALL M0N1(9,MESSSPTR); 

00187 2 CALL CRLF: 

00188 2 ENDPROCEDURE PRINTSMESS; 

00189 1 

00190 1 SELECTSDRIVE: PROCEDURE; 

00191 2 IF TFCB(0) = 0 THEN DO; 

00192 2 CURRENTSDR IVE=DEFAULTSDR IVE; 

00193 3 END: ELSE DO; 

00194 2 CURRENTSDRIVE=(TFCB(0) AND 7)-1; 

00195 3 TFCB(0)=0; 

00196 3 FI 

00197 2 IF PREVIOUSSDRIVE <> CURRENTSDRIVE THEN DO; 

00198 2 PREVIOUSSDRIVE = CURRENTSDR IVE; 

00199 3 CALL M0N1(14,CURRENTSDRIVE); 

00200 3 FI 

00201 2 ENDPROCEDURE SELECTSDRIVE; 

00202 1 



Page 24 

126 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 23 



00203 1 

00204 2 

00205 2 

00206 2 
00207 2 

00208 2 
00209 1 

00210 1 
00211 2 
00212 2 
00213 2 

00214 2 

00215 2 

00216 1 
00217 1 

00218 2 
00219 2 

00220 2 
00221 2 
00222 3 

00223 3 

00224 3 

00225 3 

00226 2 
00227 1 

00228 1 
00229 1 

00230 1 

00231 1 

00232 1 

00233 1 

00234 1 

00235 1 

00236 1 

00237 1 

00238 1 

00239 1 

00240 1 

00241 1 

00242 1 

00243 2 

00244 2 

00245 2 

00246 2 

00247 1 

00248 1 

00249 2 

00250 2 

00251 2 

00252 2 

00253 2 

00254 2 

00255 3 

00256 2 

00257 3 

00258 2 

00259 1 

00260 1 
00261 2 
00262 2 
00263 2 

00264 2 

00265 3 

00266 4 

00267 4 

00268 3 

00269 2 

00270 2 

00271 1 

00272 1 

00273 1 

00274 1 

00275 1 

00276 1 

00277 1 

00278 1 

00279 1 

00280 1 
00281 1 
00282 1 
00283 1 

00284 1 


Number 23 


UPPERSCASE: FUNCTION(CH) BYTE: 

/* MAP A CHARACTER TO UPPER CASE */ 

DECLARE CH BYTE; 

IF CH < 61H OR CH > 7AH THEN DO; RETURN CH; FI 
RETURN CH-20H; 

ENDFUNCTION UPPERSCASE; 

WAITSMS: PROCEDURE(N); 

/* N MILLI-SECOND DELAY (APPROXIMATE) */ 
DECLARE (I,N) ADDRESS; 

I =0; 

DO WHILE I < N: CALL TIME<7); 1=1+1; ENDDO 
ENDPROCEDURE WAITSMS; 

WAITSTENTH: PROCEDURE(N)J 
/* N SECOND DELAY */ 

DECLARE (I,N) ADDRESS; 

FOR 1=1 TO N: 

IF CONSBREAK THEN DO; RETURN; FI 
CALL TIME(255); 

CALL TIME(255); 

CALL TI ME(135); 

ENDDO 

ENDPROCEDURE WAITSTENTH; 


/*** OCTOPUS I/O PRIMITIVES ***/ 

DECLARE 

/* 'IN' REFERS TO TERM INAL-TO-OCTOPUS DIRECTION */ 

/* 'OUT' REFERS TO OCTOPUS-TO-TERMINAL DIRECTION */ 

OCTOSCHANNELSA BYTE INITIAL (TRUE), 

OCTOSASSTATUS LITERALLY '5', 

OCTOSASDATA LITERALLY '4' , 

OCTOSBSSTATUS LITERALLY '7' , 

OCTOSBSDATA LITERALLY '6', 

OCTOSOUTSREADY LITERALLY 'OCTOSSTATUS' 

OCTOSINSREADY LITERALLY 'ROR(OCTOSSTATUS,2)'; 

OCTOSSTATUS: FUNCTION BYTE; 

/* RETURN THE TRUE (NOT COMPLEMENTED) OCTOPUS STATUS FOR THE SELECTED PORT */ 
IF OCTOSCHANNELSA THEN RETURN NOT INPUT(OCTOSASSTATUS); 

RETURN NOT INPUT(OCTOSBSSTATUS); 

ENDFUNCTION OCTOSSTATUS; 

SENDSCH: PROCEDURE(CH); 

/* SEND A CHARACTER TO THE SELECTED OCTOPUS PORT */ 

DECLARE CH BYTE; 

DO WHILE NOT OCTOSINSREADY; ENDDO 
IF OCTOSCHANNELSA THEN DO; 

OUTPUT!OCTOSASDATA)»NOT CH; 

END: ELSE DO; 

OUTPUT(OCTOSBSDATA)=NOT CH; 

FI 

ENDPROCEDURE SENDSCH; 

RECEIVESCH: FUNCTION BYTE; 

/* GET A CHARACTER FORM THE SELECTED OCTOPUS CHANNEL */ 

DECLARE I ADDRESS; 

FOR 1=0 TO 65000; 

IF OCTOSOUTSREADY THEN DO; 

IF OCTOSCHANNELSA THEN RETURN (NOT INPUT(OCTOSASDATA)) AND 7FH; 

RETURN (NOT INPUT(OCTOSBSDATA)) AND 7FH; 

FI 

ENDFOR 
RETURN OFFH; 

ENDFUNCTION RECEIVESCH; 


/*** BLOCK AND FREE STORAGE GLOBALS ***/ 

DECLARE 

FSSFIRSTSPTR ADDRESS, /* FREE STORAGE HEAD */ 

BLOCKSLENGTH LITERALLY '16' 

BLOCKSLAST LITERALLY '15' 

PTRSMASK LITERALLY 'O^FFOH', 

NOTSPTRSMASK LITERALLY 'OFH', 

(FIRSTSGETASFLAG,FIRSTSGETBSFLAG,FIRSTSPUTASFLAG) BYTE, 

(GETSCHASCHSPTR,PUTSCHASCHSPTR,PUTSCHASCURRENTSBLOCKSPTR) ADDRESS; 



Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 25 

127 



/*** 0LOBALS FOR SCAN ALGORITHM ***/ 


00285 1 

00286 1 
00287 1 

00288 1 
00289 1 

00290 1 

00291 1 

00292 1 

00293 1 

00294 1 

00295 1 

00296 1 

00297 1 

00298 1 

00299 1 

00300 1 

00301 1 

00302 1 

00303 1 

00304 1 

00305 1 

00306 1 

00307 1 

00308 1 

00309 1 

00310 1 

00311 1 

00312 1 

00313 1 

00314 1 

00315 1 

00316 1 

00317 1 

00318 1 

00319 1 

00320 1 

00321 1 

00322 1 

00323 1 

00324 1 

00325 1 

00326 1 

00327 1 

00328 1 

00329 1 

00330 1 

00331 1 

00332 2 

00333 2 

00334 2 

00335 2 

00336 2 

00337 2 

00338 2 

00339 2 

00340 1 

00341 1 

00342 2 

00343 2 

00344 2 

00345 2 

00346 2 

00347 2 

00348 2 

00349 2 

00350 2 

00351 2 

00352 2 

00353 2 

00354 2 

00355 3 

00356 3 

00357 4 

00358 4 

00359 3 

00360 4 

00361 3 

00362 2 

00363 3 

00364 3 

00365 3 

00366 3 

00367 3 

00368 3 

00369 3 

00370 3 

00371 3 

00372 3 

00373 3 

00374 2 

00375 1 


Page 26 

128 


DECLARE 

NSSSTACK(255) ADDRESS INITIAL (11B.1B), /* NEUTRAL STACK, 8-BIT INDEX */ 

NS$STACK$INDEX BYTE, /* INDEX OF CURRENTLY 'OPEN' ARGUMENT */ 

NS9SAVESINDEX BYTE, /* INDEX OF FIRST ARGUMENT OF CURRENT FUNCTION #/ 
NSSCHSPTR ADDRESS, /* NEXT NEUTRAL CHARACTER ADDRESS */ 

NSSCH BASED NSSCHSPTR BYTE, 


NSSARGSBREAK BYTE, 
NSSARGSFLAG LITERALLY 

NSSBEGINSENDSBIT LITERALLY 
NSSFUNSBIT LITERALLY 

NSSACTIVESBIT LITERALLY 

NSSNULLSBEGINSEND LITERALLY 
NSSFUNSMARKER LITERALLY 


/* LAST FOUR BITS OF NS STACK ENTRY */ 
/* MARKS LIMITS OF NEUTRAL STACK */ 

/* MARKS FIRST ARG OF FUNCTION */ 

/* MARKS ACTIVE FUNCTION */ 


NSSLIMITSMARKER 


'OOOOB', 

'0001B', 

'001 OB', 

'01OOB', 

'1001B'. 

'ROR(LOW(NSSSTACKt NSSSTACK*INDEX)),1) 
/* NS BEG IN-FUNCTI ON TEST »/ 

LITERALLY 'LOW ( NSSSTACK(NSSSTACKSINDEX))', 

/* NS BEGIN-END TEST */ 


NSSACTIVESFLAG BYTE, 

ASSBLOCKSPTR ADDRESS INITIAL(O), /* CURRENT BLOCK IN ACTIVE STRING */ 
ASSBLOCK BASED ASSBLOCKSPTR ADDRESS, 

ASSCHSPTR ADDRESS, /* ADDRESS OF NEXT ACTIVE STRING CHARACTER */ 

ASSCH BASED ASSCHSPTR BYTE, 

(SSSCHASPTR,SSSCHBSPTR,SSSCHCSPTR) ADDRESS, /* SUBSTRING SEARCH PTRS */ 
SSSMASK LITERALLY '11000000B', 

SSSCHA BASED SSSCHASPTR BYTE, 

MOVESPTR LITERALLY 'TRUE', /* FLAGS FOR ASSNEXTSCH CALL */ 

DONTSMOVESPTR LITERALLY 'FALSE' 

TRACESFLAG BYTE, /* 8 BIT 'STACK'. LOW ORDER BIT IS CURRENT */ 

(NAMESPTR,ARGSPTR) ADDRESS, /* GENERAL USE IN PF'S AND TRACE */ 

NEXTSARG LITERALLY 'WHILE NOT LOW(ARGSPTR:=NEXT$NS)', /* IN PF'S */ 

VALUESPTR ADDRESS, /* USED BY PF'S TO RETURN THEIR VALUE */ 

VALUESCH BASED VALUESPTR BYTE, 

(SSPTR,FSPTR) ADDRESS, /* USED BY PF'S FOR SUCCESS AND FAIL VALUES */ 
NULLSSTRINGSPTR ADDRESS, /* ORED WITH NSSBEGINSENDSBIT IN NS STACK */ 
DEADSSTART BYTE INITIAL (TRUE), 

NOSEXSVALUE BYTE INITIAL (TRUE); 


/*** FREE STORAGE AND OTHER BLOCK STRUCTURE UTILITIES ***/ 

FSSFREE: PROCEDURE(FREESTHISSPTR); 

/* ADD THE INDICATED BLOCK TO THE FREE STORAGE LIST */ 

DECLARE 

FREESTHISSPTR ADDRESS, 

FREESTHIS BASED FREESTHISSPTR ADDRESS; 

FREESTHIS=FSSFIRSTSPTR; 

FSSFIRST$PTR=FREESTHISSPTR; 

ENDPROCEDURE FSSFREE; 

FSSGET: FUNCTION ADDRESS: 

/* ALLOCATE A BLOCK FROM FREE STORAGE, RETURN ITS ADDRESS */ 

/* SET 'NEXT' FIELD TO END-CHAIN (ZERO HIGH BYTE) */ 

/* AND FILL WITH NILS */ 

DECLARE 

FSSFIRST BASED FSSFIRSTSPTR ADDRESS, 

GOTSPTR ADDRESS. 

GOT BASED GOTSPTR ADDRESS, 

GOTC BASED GOTSPTR BYTE, 

FIRSTSEMPTY BYTE INITIAL (TRUE), 

NILNIL LITERALLY '8181H'; 

IF HIGH(FSSFIRSTSPTR) = 0 THEN DO; 

CALL PRINT$MESS(.'FREE STORAGE IS EMPTY S'); 

IF FIRSTSEMPTY THEN DO; 

FIRST$EMPTY=FALSE; 

GO TO START; 

END; ELSE DO; 

EX I T; 

FI 

END; ELSE DO; 

G0T$PTR=FSSFIRSTSPTR; 

FSSFIRST$PTR=FS$FIRST; 

GOT = 0; 

GOT(1)=NILNIL; 

GOT(2)=NILNIL; 

GOT(3)=NILNIL; 

GOT(4)=NILNIL; 

GOT(5)=NILNIL; 

GOT(6)= NILNIL; 

GOT(7)= NILNIL; 

RETURN GOTSPTR; 

FI 

ENDFUNCTI ON FSSGET; 



Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 23 



00376 1 

00377 2 

00378 2 

00379 2 

00380 2 

00381 2 

00362 2 

00383 3 

00384 2 

00385 1 

00386 1 

00387 2 

00388 2 

00369 2 

00390 2 

00391 2 

00392 2 

00393 3 

00394 3 

00395 3 

00396 3 

00397 2 

00398 1 

00399 1 

00400 2 

00401 2 

00402 2 

00403 2 

00404 2 

00405 2 

00406 2 

00407 2 

00408 2 

00409 2 

00410 2 

00411 3 

00412 2 

00413 2 

00414 2 

00415 2 

00416 3 

00417 2 

00418 2 

00419 2 

00420 2 

00421 3 

00422 3 

00423 2 

00424 2 

00425 1 

00426 1 

00427 2 

00428 2 

00429 2 

00430 2 

00431 2 

00432 2 

00433 2 

00434 2 

00435 2 

00436 2 

00437 2 

00438 3 

00439 3 

00440 3 

00441 2 

00442 2 

00443 3 

00444 3 

00445 3 

00446 2 

00447 2 

00448 1 

00449 1 

00450 2 

00451 2 

00452 2 

00453 2 

00454 2 

00455 2 

00456 2 

00457 2 

00458 2 

00459 2 

00460 3 

00461 3 

00462 3 

00463 2 

00464 2 

00465 3 

00466 3 

00467 2 

00468 2 

00469 1 


FSSINIT: PROCEDURE(MINSADDRESS,MAXSADDRESS); 

/* CREATE FREE STORAGE LIST */ 

/# MAXSADDRESS MUST BE A MULTIPLE OF BLOCKSLENGTH */ 

DECLARE (MINSADDRESS, MAXSADDRESS,BLKSPTR) ADDRESS; 

FOR BLK$PTR=MINSADDRESS TO MAX$ADDRESS-BLOCKSLENGTH BY BLOCKSIFNOTH; 

CALL FSSFREE(BLKSPTR); 

ENDFOR 

ENDPROCEDURE FSSINIT; 

FREESCHAIN: PROCEDURE(BLOCKSPTR) ; 

/# FREE ALL BLOCKS IN A CHAIN STARTING WITH BLOCKSPTR */ 

DECLARE (BLOCKSPTR,BLOCK BASED BLOCKSPTR,NEXTSPTR) ADDRESS; 

IF (BLOCKSPTR:=BLOCK$PTR AND PTRSMASK) = NULLSSTRINGSPTR THEN DO; RETURN; FI 
DO FOREVER; 

IF HIGH(BLOCKSPTR) 3 0 THEN DO; RETURN; FI 
NEXTSPTR 3 BLOCK; 

CALL FSSFREE(BLOCKSPTR); 

BLOCKSPTR=NEXTSPTR; 

ENDDO; 

ENDPROCEDURE FREESCHAIN; 

APPENDSCH: FUNCTI ON(CH,BLOCKSPTR) ADDRESS; 

/* STARTING WITH BLOCKSPTR (<>0), SEARCH FOR THE LAST BLOCK */ 

/* APPEND CH AND RETURN THE NEXT CHARACTER ADDRESS */ 

DECLARE 

CH BYTE, 

(BLOCKSPTR,BLOCK BASED BLOCKSPTR,CHSPTR) ADDRESS, 

BLOCKC BASED CHSPTR BYTE; 

IF HIGH(BLOCKSPTR) = 0 THEN DO; RETURN 0; FI 

DO WHILE HIGH(BLOCK) > 0; 

BLOCKSPTR=BLOCK; 

ENDDO 

CHSPTR 3 BLOCKSPTR+2; 

DO WHILE BLOCKC <> NIL; 

CHSPTR 3 CHSPTR +1; 

ENDDO 

BLOCKC=CH' 

IF (LOW(CHSPTR:=CHSPTR+1) AND NOTSPTRSMASK) = 0 THEN DO; 

BLOCK,CHSPTR 3 FSSGET; 

CHSPTR=CHSPTR+2; 

FI 

RETURN CHSPTR; 

ENDFUNCTI ON APPENDSCH; 

GETSCHA: FUNCTI ON(INITIALSBLOCKSPTR) BYTE; 

/.* RETURNS THE NEXT 8-BIT CHARACTER FROM CHAIN 'A' */ 

/* TO INITIALIZE FOR A NEW CHAIN. SET FIRSTSGETASFLAG TO TRUE */ 

/* CALLER MUST TEST FOR STRING TERMINAL */ 

/* GETSCHASPTR POINTS TO THE LAST RETURNED CHARACTER */ 

DECLARE 

(INITIALSBLOCKSPTR.CURRENTSBLOCKSPTR) ADDRESS, 

CURRENTSBLOCK BASED CURRENTSBLOCKSPTR ADDRESS, 

(CH BASED GETSCHASCHSPTR,NEWSCHAIN) BYTE; 

IF FIRSTSGETASFLAG THEN DO; 

FIRSTSGETASFLAG 3 FALSE; 

CURRENTSBLOCKSPTR=INITIALSBLOCKSPTR; 

GETSCHASCHSPTR 3 CURRENTSBLOCKSPTR+1; 

FI 

IF (LOW(GETSCHASCHSPTR:=GETSCHASCHSPTR+1) AND NOTSPTRSMASK) = 0 THEN DO; 
CURRENT$BLOCK$PTR=GETSCHA$CH$PTR-BLOCKSLENGTH; 

CURRENTSBLOCKSPTR=CURRENT$BLOCK; 

GETSCHA$CHSPTR=CURRENTSBL0CKSPTR+2; 

FI 

RETURN CH; 

ENDFUNCTI ON GETSCHA; 

GETSCHB: FUNCTI ON(INITIALSBLOCKSPTR) BYTE: 

/* RETURNS THE NEXT 8-BIT CHARACTER FROM CHAIN 'B' */ 

/* TO INITIALIZE FOR A NEW CHAIN, SET FIRSTSGETBSFLAG TO TRUE */ 

/* CALLER MUST TEST FOR STRING TERMINAL */ 

DECLARE 

(I NIT IALSBLOCKSPTR,CURRENTSBLOCKSPTR,CHSPTR) ADDRESS, 

CURRENTSBLOCK BASED CURRENTSBLOCKSPTR ADDRESS, 

(CH BASED CHSPTR,NEWSCHAIN) BYTE; 

IF FIRSTSGETBSFLAG THEN DO; 

FIRSTSGETBSFLAG=FALSE; 

CURRENTSBLOCKSPTR 3 INITIALSBLOCKSPTR; 

CH$PTR=CURRENT$BLOCKSPTR+1; 

FI 

IF (LOW(CHSPTR:=CHSPTR+1) AND NOTSPTRSMASK) = 0 THEN DO; 
CURRENTSBLOCKSPTR=CURRENTSBLOCK; 

CHSPTR 3 CURRENTSBLOCKSPTR+2; 

FI 

RETURN CH; 

ENDFUNCT1 ON GETSCHB; 


Number 23 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 27 

129 



00470 

00471 

00472 

00473 

00474 

00475 

00476 

00477 

00478 

00479 

00480 

00481 

00482 

00483 

00484 

00485 

00486 

00487 

00488 

00489 

00490 

00491 

00492 

00493 

00494 

00495 

00496 

00497 

00498 

00499 

00500 

00501 

00502 

00503 

00504 

00505 

00506 

00507 

00508 

00509 

0051 0 

0051 1 

0051 2 

0051 3 

0051 4 

0051 5 

0051 6 

0051 7 

0051 8 

0051 9 

00520 

00521 

00522 

00523 

00524 

00525 

00526 

00527 

00528 

00529 

00530 

00531 

00532 

00533 

00534 

00535 

00536 

00537 

00538 

00539 

00540 

00541 

00542 

00543 

00544 

00545 

00546 

00547 

00548 

00549 

00550 

00551 

00552 

00553 

00554 

00555 

00556 

00557 

00558 

00559 

00560 

00561 

00562 

00563 

00564 

00565 

Page 28 

130 


1 

2 

2 

2 

2 

2 

2 

2 

2 

2 

2 

2 

2 

3 

3 

3 

2 

2 

2 

3 

3 

2 

1 

1 

2 

2 

2 

2 

2 

2 

2 

2 

2 

2 

2 

3 

4 
3 
2 
1 
1 

2 

2 

2 

2 

2 

2 

3 

3 

3 

3 

2 

2 

3 

3 

3 

3 

2 

2 

2 

2 

3 

2 

2 

1 

1 

2 

2 

2 

2 

2 

2 

2 

2 

2 

3 

2 

2 

1 

1 

2 

2 

2 

2 

2 

2 

2 

2 

3 

4 

5 

4 

5 
4 
3 
2 


PUTSCHA: PROCEDURE(INITIALSBLOCKSPTR,CHA); 

/* PUT CHA INTO THE CHAIN 'A' */ 

/* TO INITIALIZE FOR A NEW CHAIN, SET FIRSTSPUTASFLAG TO TRUE */ 

/* AND SET INITlALSBLOCKSPTR TO FSSGET */ 

/* PUTSCHASCHSPTR POINTES TO THE NEXT CHAR TO BE STORED */ 

DECLARE 

INITIALSBLOCKSPTR ADDRESS, 

CURRENTSBLOCK BASED PUTSCHASCURRENTSBLOCKSPTR ADDRESS, 

(CH BASED PUTSCHASCHSPTR,NEWSCHAIN,CHA) BYTE; 

IF FIRSTSPUTASFLAG THEN DO; 

FIRSTSPUTASFLAG=FALSE: 

PUTSCHASCURRENTSBLOCKSPTR*INITIALSBLOCKSPTR; 
PUTSCHASCHSPTR=PUTSCHASCURRENTSBL0CKSPTR+2; 

FI 

CH = CHA * 

IF~(L0W(PUTSCHASCHSPTR:=PUT*CHASCHSPTR+1) AND NOTSPTRSMASK) * 0 THEN DO; 
CURRENTSBLOCK.PUTSCHASCURRENTSBLOCKSPTR=FSSQET; 

PUTSCHASCHSPTR*PUTSCHASCURRENTSBLOCKSPTR+2; 

FI 

ENDPROCEDURE PUTSCHA; 

COPYSVALUE: PROCEDURE(SOURCESPTR.SINKSPTR); 

/* SOURCESPTR IS THE ADDRESS OF THE SOURCE CHAIN */ 

/* SINKSPTR IS THE ADDRESS OF AN EMPTY BLOCK */ 

/* ONLY 7-BIT CHARACTERS ARE COPIED */ 

/* NOTE: PFSIN USES THE FINAL VALUE OF GETSCHASCHSPTR */ 

DECLARE 

(SOURCESPTR,SINKSPTR) ADDRESS, 

CH BYTE; 

FIRSTSGETASFLAG.FIRSTSPUTASFLAG=TRUE; 

DO WHILE (CH:=GET$CHA(SOURCESPTR)) <> NIL; 

IF NOT ROL(CH,1) THEN DO; 

CALL PUTSCHAtSINKSPTR,CH); 

FI 

ENDDO 

ENDPROCEDURE COPYSVALUE; 

STRINGSEQUALITY: FUNCTION(PTA,PTB) BYTE: 

/* TRUE IF STRINGS CONTAIN THE SAME SEQUENCE OF 7-BIT CHARACTERS */ 
DECLARE 

(PTA,PTB) ADDRESS, 

(CHA,CHB) BYTE; 

NEXTA: FUNCTION BYTE; 

DO WHILE ((CHA:=GETSCHA(PTA)) <> NIL) AND R0L(CHA,1); 

ENDDO 

RETURN CHA; 

ENDFUNCTI ON NEXTA; 

NEXTB: FUNCTION BYTE; 

DO WHILE ((CHB:=GETSCHB(PTB)) <> NIL) AND R0L(CHB,1); 

ENDDO 

RETURN CHB; 

ENDFUNCTION NEXTB; 

FIRSTSGETASFLAG,FIRSTSGETBSFLAG=TRUE; 

DO WHILE NEXTA = NEXTB: 

IF CHA = NIL THEN DO; RETURN TRUE; FI 
ENDDO 

RETURN FALSE; 

ENDFUNCTI ON STRINGSEQUALITY; 

NULLSTEST: FUNCTI ON(BLOCKSPTR) BYTE; 

/* 'TRUE' IF THERE ARE NO 7-BIT CHARACTERS BEFORE THE NIL */ 

DECLARE 

BLOCKSPTR ADDRESS, 

CH BYTE; 

IF HIGH(BLOCKSPTR) = 0 THEN DO; RETURN TRUE; FI 
FIRSTSGETASFLAG=TRUE; 

DO WHILE (CH:=GETSCHA(BLOCKSPTR AND PTRSMASK)) <> NIL; 

IF NOT ROL(CH,1) THEN DO; RETURN FALSE; FI 
ENDDO 

RETURN TRUE; 

ENDFUNCTI ON NULLSTEST; 

PR 1NTSSTRING: PROCEDURE(BLOCKSPTR); 

/# PRINT ALL 7-BIT CHARACTERS IN THE STRING */ 

DECLARE 

BLOCKSPTR ADDRESS, 

CH BYTE; 

FIRSTSGETASFLAG = TRUE: 

DO WHILE (CH:=GET$CHA(BLOCKSPTR AND PTRSMASK)X>NIL AND NOT TERMS INSRFADY; 
IF NOT ROL(CH,1) THEN DO; 

IF CPMSPRINTSFLAG THEN DO; 

CALL PR INTSCH(CH); 

END; ELSE DO; 

CALL DI SPLAYSCH(CH); 

FI 

FI 

ENDDO 

ENDPROCEDURE PR INTSSTRING; 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 23 



00566 1 

00567 1 

00568 1 

00569 1 

00570 1 

00571 2 

00572 2 

00573 2 

00574 1 

00575 1 

00576 2 

00577 2 

00578 2 

00579 2 

00500 2 

00581 2 

00582 2 

00583 3 

00584 2 

00585 1 

00586 1 

00587 2 

00588 2 

00589 2 

00590 2 

00591 2 

00592 2 

00593 2 

00594 2 

00595 2 

00596 2 

00597 3 

00598 3 

00599 3 

00600 3 

00601 4 

00602 4 

00603 5 

00604 5 

00605 4 

00606 3 

00607 3 

00608 4 

00609 4 

00610 4 

00611 3 

00612 3 

00613 2 

00614 2 

00615 2 

00616 3 

00617 2 

00618 3 

00619 3 

00620 3 

00621 2 
00622 2 
00623 2 

00624 2 

00625 2 

00626 2 
00627 3 

00628 4 

00629 5 

00630 5 

00631 5 

00632 4 

00633 3 

00634 2 

00635 2 

00636 1 

00637 1 

00638 1 

00639 1 

00640 1 

00641 1 

00642 1 

00643 1 

00644 1 

00645 1 

00646 1 

00647 1 

00648 1 

00649 1 

00650 1 

00651 1 

00652 1 

00653 1 

00654 1 

00655 1 

00656 1 

00657 1 

00658 1 


/*** OCTOPUS I/O UTILITIES ***/ 

CLEAR$OCTO$0UTPUT: PROCEDURE; 

CALL WAITSTENTH C 2); 

DO WHILE 0CTOSOUTSREADY; DUMMY=RECEIVESCH; CALL WAIT$TENTH(2); ENDDO 
ENDPROCEDURE CLEARSOCTOSOUTPUT; 

SENDSSTRING: PROCEDURE(BLOCKSPTR); 

/« SEND A MESSAGE TO OCTOPUS. (USUALLY WITHOUT END-OF-LINE CHARACTER) */ 
/* IGNORE THE ECHO */ 

DECLARE BLOCKSPTR ADDRESS, CH BYTE; 

CALL CLEARSOCTOSOUTPUT; 

FIRST$GETA$FLAG=TRUE; 

DO WHILE (CH:--GETSCHA(BLOCKSPTR)) <> NIL; 

IF NOT ROL(CH,1) THEN DO; CALL SENDSCH(CH); FI 
ENDDO 

ENDPROCEDURE SENDSSTRING; 

RECEIVESSTRING: FUNCTION(ENDSMESSAGESPTR) BYTE; 

/* RECEIVE AN OCTOPUS MESSAGE. VALUESPTR WILL ADDRESS IT */ 

/* VALUE IS FALSE IF TIME-OUT BEFORE END-MESSAGE IS RECOGNIZED */ 

/* DOES NOT SEND EOT IF ZERO DELAY */ 

/* NOTE: GET A LOG-OFF IF NULL MESSAGE AND DELAY > 0 */ 

DECLARE 

(ENDSMESSAGESPTR,RESTARTSPTR,COUNT,COUNTSMAX,I) ADDRESS, 

CHA BYTE, 

CYCLES*PERSSECOND LITERALLY '5000'; /* DEPENDENT ON HARDWARE TIMING */ 


MATCHSEND: FUNCTION BYTE; 

FIRSTSGETBSFLAG=TRUE; 

GETSCHASCHSPTR=RESTARTSPTR; 

DO WHILE (CHA:*GETSCHA(0)) = GETSCHB(ENDSMESSAGESPTR); 

IF CHA = NIL THEN DO; RETURN TRUE; FI 

IF OCTOSOUTSREADY THEN DO; /* DON*T LOSE HIGH BAUD INPUT */ 
COUNT=COUNT$MAX; 

CALL PUTSCHA(0,RECEIVESCH); 

FI 

ENDDO 

IF CHA <> NIL THEN DO; 

GET$CHASCHSPTR=RESTART$PTR; 

DUMMY = GETSCHA(0) ; 

RESTART$PTR*GETSCHASCHSPTR; 

FI 

RETURN FALSE; 

ENDFUNCTI ON MATCHSEND; 


IF OCTOSTIMEOUT = 0 THEN DO; 

C0UNT$MAX=2; 

END: ELSE DO; 

COUNTSMAX=OCTOSTIMEOUT+1; 
CALL CLEARSOCTOSOUTPUT; 
CALL SENDSCH(OCTOSEOM); 


RESTARTSPTR=(VALUESPTR:=FSSGET) +1 ; 

FIRSTSPUTASFLAG=TRUE; 

COUNT = COUNTSMAX; 

DO WHILE (COUNT:=COUNT-1) <> 0 AND NOT CONSBREAK; 
FOR 1=0 TO CYCLESSPERSSECOND; 

IF OCTOSOUTSREADY THEN DO; 

COUNT=COUNTSMAX; 

CALL PUTSCHACVALUESPTR,RECEIVESCH); 

IF MATCHSEND THEN DO; RETURN TRUE; FI 
FI 

ENDFOR 

ENDDO 

RETURN FALSE; 

ENDFUNCTI ON RECEIVESSTRING; 


/*** SYMBOL TABLE ROUTINES ***/ 


/* A HASH TABLE, WHICH IS AN ARRAY OF 32 CHAIN POINTERS, IS USED. */ 
/* EACH ENTRY IS A BLOCK WITH THE FOLLOWING FIELDS: (NO. BYTES IN FIELD) */ 
/* NEXT(2) , CH-PTR(2), VALUE(2), NAME(2), NAME-TEXT(8) */ 

/* STSFIND DOES A LOOKUP AND SETS STSENTRYSPTR AND HASHSINDEX . */ 
/* STSDELETE DELETES THE PREVIOUSLY FOUND ENTRY AT STSENTRYSPTR. */ 
/* STSCREATE CREATES AN ENTRY AT HASHSINDEX. */ 
/* STSADDSVALUE FILLS IN THE VALUE PTR FOR THE ENTRY AT STSENTRYSPTR */ 


DECLARE /* SYMBOL TABLE STUFF */ 

HASHSTABLE(32) ADDRESS, /*ADDRESS OF FIRST IN CHAIN OF EQUAL HASH ENTRIES*/ 
HASHSINDEX BYTE. /* INDEX INTO HASHSTABLE, SET BY STSFIND */ 

STSENTRYSPTR ADDRESS. /* ADDRESS OF AN ENTRY (BLOCK) */ 

STSENTRY BASED STSENTRYSPTR ADDRESS, 

STSPREVIOUSSPTR ADDRESS, /* ADDRESS OF CHAIN POINTER TO CURRENT STSENTRY */ 
STSPREVIOUS BASED STSPREVIOUSSPTR ADDRESS, /* HASH INDEX OF PREVIOUS BLOCK */ 
STSCHSPTRSINDEX LITERALLY '1', /* STSENTRY(1) IS LAST CH PTR (FORM PTR)*/ 

STSVALUESINDEX LITERALLY '2', /* STSENTRY(2) IS THE VALUE POINTER */ 

STSNAMESINDEX LITERALLY '3', /* STSENTRY(3) IS PTR TO REST OF NAME */ 

STSNAMESOFFSET LITERALLY '6'; /* STSENTRYSPTR+6 IS START OF NAME BLOCK */ 


Number 23 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 29 

131 




00659 1 

00660 1 
00661 2 
00662 2 
00663 1 

00664 1 

00665 2 

00666 2 
00667 2 

00666 2 
00669 2 

00670 2 

00671 2 

00672 2 

00673 2 

00674 2 

00675 3 

00676 2 

00677 2 

00678 2 

00679 3 

00680 2 
00681 2 
00682 2 
00683 3 

00684 3 

00685 2 

00686 2 
00687 1 

00668 1 
00689 2 

00690 2 

00691 2 

00692 2 

00693 2 

00694 2 

00695 2 

00696 1 

00697 1 

00698 2 

00699 2 

00700 2 

00701 2 

00702 2 

00703 2 

00704 2 

00705 2 

00706 2 

00707 2 

00708 2 

00709 1 

00710 1 

00711 2 

00712 2 

00713 2 

00714 2 

00715 2 

00716 2 

00717 2 

00718 2 

00719 1 

00720 1 

00721 2 

00722 2 

00723 2 

00724 2 

00725 2 

00726 2 

00727 2 

00728 2 

00729 2 

00730 2 

00731 2 

00732 2 

00733 2 

00734 2 

00735 2 

00736 2 

00737 2 

00738 2 

00739 3 

00740 2 

00741 2 

00742 1 

00743 1 


Page 30 

132 


STSINIT: PROCEDURE: 

FOR HASHSINDEX=0 TO LASTCHASHSTABLE); HASHSTABLECHASHSINDEX)=0; ENDFOR 
ENDPROCEDURE STSINIT; 

STSFIND: FUNCTI ON(NAMESPTR) BYTE: 

/* IF FOUND. VALUE IS TRUE AND STSENTRYSPTR, STSPREVIOUSSPTR ARE SET */ 

/* IN ANY CASE, HASHSINDEX IS SET */ 

DECLARE 

NAMESPTR ADDRESS, 

(HASH,CH) BYTE, 

HASHSMASK LITERALLY '1111 IB’; /* FOR 32 HASH CHAINS */ 

HASH=0; FIRSTSGETASFLAG=TRUE; 

DO WHILE (CH:=GET$CHA(NAMESPTR)) <> NIL; 

HASH=HASH+CH; 

ENDDO; 

IF HIGHCSTSENTRYSPTR:=HASHSTABLE(HASHSINDEX:=HASH AND HASHSMASK))=0 THEN DO; 

RETURN FALSE; 

FI 

STSPREVI0US$PTR=.HASHSTABLE(HASHSINDEX); 

DO WHILE NOT STRINGSEQUALITY(NAMESPTR,STSENTRYSPTR+STSNAMESOFFSET); 

STSPREVIOUSSPTR=STSENTRYSPTR; 

IF HIGH(STSENTRYSPTR:=STSENTRY) = 0 THEN DO; RETURN FALSE; F! 

ENDDO 

RETURN TRUE; 

ENDFUNCTI ON STSFIND; 

STSDELETE: PROCEDURE; 

/* DELETE THE SYMBOL TABLE ENTRY AT STSENTRYSPTR */ 

/* BUT FIRST FREE THE NAME AND VALUE CHAINS */ 

CALL FREESCHAIN(ST$ENTRY(STSNAMES INDEX)); 

CALL FREESCHAIN(STSENTRY(STSVALUESINDEX)); 

STSPREVIOUS=STSENTRY; 

CALL FSSFREE(STSENTRYSPTR); 

ENDPROCEDURE STSDELETE; 

STSCREATE: PROCEDURE(NAMESPTR); 

/* CREATE AN ENTRY AT HASHS!NDEX, LEAVE STSENTRYSPTR SET */ 

/* VALUE PTR TO BE FILLED IN LATER BY STSADDSVALUE */ 

DECLARE NAMESPTR ADDRESS; 

ST$ENTRY$PTR=FSSGET; 

STSENTRY=HASH$TABLE(HASHSINDEX); 

HASHSTABLE(HASHSINDEX)=STSENTRY*PTR; 

STSENTRY(STSNAMESINDEX)=0; 

CALL COPY$VALUE(NAME$PTR,STSENTRYSPTR + STSNAMESOFFSET) ; 

STSENTRY(STSVALUESINDEX)=0; 

ENDPROCEDURE STSCREATE; 

STSADDSVALUE: PROCEDURE(STSVALUESPTR); 

/* FILL IN THE VALUE PTR IN ENTRY AT STSENTRYSPTR */ 

/* ALSO RESET FORMPTR */ 

DECLARE STSVALUESPTR ADDRESS; 

CALL FREESCHAIN(STSENTRY(STSVALUESINDEX)); 

STSENTRY(STSVALUESINDEX)=ST$VALUE$PTR; 

STSENTRY(STSCHSPTRSINDEX)=ST$VALUE$PTR+1; 

ENDPROCEDURE STSADDSVALUE; 

STSREINIT: PROCEDURE: 

/* DEFINE THE IDLE MACRO SIM = S(PS,S(RS,.)) #/ 

DECLARE IM DATA 

(FUNSCH,LEFTSDELIM,LITSP,LITSS,ARGSDELIM, 

FUNSCH,LEFTSDELIM,LITSR,LITSS,ARGSDELIM,'.',RIGHTSDELIM,RIGHTSDELIM); 

FIRSTSPUT ASFLAG = TRUE; 

CALL PUTSCHA(TEMPSPTR:=FSSGET,FUNSCH); 

CALL PUTSCHA(0,LITSI); 

CALL PUTSCHACO,LITSM); 

DUMMY=ST$FIND(TEMPSPTR); 

CALL STSCREATE!TEMPSPTR); 

CALL FSSFREE(TEMPSPTR); 

FIRSTSPUTA$FLAG=TRUE; 

TEMPSPTR=FS$GET; 

FOR ITEMP=0 TO LAST(IM); 

CALL PUTSCHA(TEMPSPTR, IM(I TEMP)); 

ENDFOR 

CALL STSADDSVALUE(TEMPSPTR); 

ENDPROCEDURE STSREINIT; 



Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 23 


00744 1 

00745 1 

00746 1 

00747 2 

00748 2 

00749 2 

00750 2 

00751 2 

00752 1 

00753 1 

00754 2 

00755 2 

00756 1 

00757 1 

00758 1 

00759 1 

00760 1 

00761 2 

00762 2 

00763 3 

00764 4 

00765 4 

00766 4 

00767 3 

00768 3 

00769 2 

00770 1 

00771 1 

00772 2 

00773 2 

00774 2 

00775 1 

00776 1 

00777 2 

00778 2 

00779 1 

00780 1 

00781 2 

00782 2 

00783 2 

00784 2 

00785 2 

00786 2 

00787 2 

00788 2 

00789 2 

00790 2 

00791 2 

00792 3 

00793 2 

00794 3 

00795 2 

00796 3 

00797 2 

00798 2 

00799 1 

00800 1 
00801 1 
00802 1 
00803 1 

00804 2 

00805 2 

00806 2 
00807 2 

00808 2 
00809 2 

00810 2 
00811 2 
00812 2 
00813 2 

00814 2 

00815 3 

00816 3 

00817 4 

00818 3 

00819 2 

00820 3 

00821 3 

00822 2 
00823 2 

00824 2 

00825 2 

00826 2 
00827 2 

00828 3 

00829 2 

00830 2 

00831 1 


/#** GENERAL UTILITIES FOR SCAN AND PRIMITIVE FUNCTIONS ***/ 

THISSNS: FUNCTION ADDRESS; 

DECLARE THIS ADDRESS; 

TH1S=NSSSTACK(NSSSTACKStNDEX); 

NSSSTACKSINDEX=NSSSTACKS INDEX+1; 

RETURN THIS; 

ENDFUNCTI ON THISSNS; 

NEXTSNS: FUNCTION ADDRESS; 

RETURN NSSSTACK(NSSSTACKSINDEX:=NSSSTACKSINDEX+1); 

ENDFUNCTI ON NEXTSNS; 


/*#* DEBUG AIDS *#*/ 

TRACESPRINT: PROCEDURE; 

DO FOREVER; 

IF (VALUESPTR:=THIS$NS) THEN DO; 

CALL CRLF; 

NSSSTACKSINDEX = NS$SAVES INDEX; 

RETURN; 

FI 

CALL PR INTSSTRING(VALUESPTR); CALL PR INTSCH(5CH); 

ENDDO 

ENDPROCEDURE TRACESPRINT; 

TURNSTRACESON! PROCEDURE; 

TRACE$FLAG=SHL(TRACESFLAG,1) OR 1; 

CPMSPRINT$FLAG=TRUE; 

ENDPROCEDURE TURNSTRACESON; 

TURNSTRACESOFF: PROCEDURE; 

TRACESFLAG=SHR(TRACESFLAG,1); 

ENDPROCEDURE TURNSTRACESOFF; 

PROCESSSCONSBREAK: PROCEDURE; 

DECLARE CH BYTE; 

IF NOT STSFINDC.ATSCB) THEN DO; CALL STSCREATE(.ATSCB); FI 
FIRSTSPUTASFLAG=TRUE; 

CALL PUTSCHAIVALUESPTR:=FSSGET,CH:=READSCH); 

CALL STSADDSVALUEIVALUESPTR); 

IF CH <> ESC THEN DO; RETURN: FI 
CALL PR INTSMESS(, ' TNI: S*); 

IF C CH:=READ$CH) = LITST THEN DO; /* 'T */ 

CALL TURNSTRACESON; 

END; ELSE IF CH = LITSN THEN DO; /* 'N' */ 

CALL TURNSTRACESOFF; 

END: ELSE IF CH = LITSI THEN DO; /* 'I' */ 

GO TO START; 

FI 

CALL CRLF; 

ENDPROCEDURE PROCESSSCONSBREAK; 


/*** UTILITIES FOR SCAN ALGORITHM ***/ 
ASSNSSINIT: PROCEDURE: 

/* LOAD THE IDLE MACRO; RESET THE NEUTRAL STRING */ 
DECLARE 

CLSIM DATA 

(FUNSCH,LEFTSDELIM,FUNSCHj L l T$ I , LITSM,RIGHTSDELIM), 


/* RELEASE ACTIVE STRING BLOCKS, THEN SET ACTIVE TO S(SIM) */ 

CALL FREESCHAIN(ASSBLOCKSPTR); 

AS$BLOCK$PTR=FS$GET; 

IF NOSEXSVALUE THEN DO: 

FIRSTSPUTASFLAG=TRUE; 

FOR 1=0 TO LASTCCLSIM); 

CALL PUTSCHA(ASSBLOCKSPTR,CL$IM<I)); 

ENDFOR 

END: ELSE DO; 

CALL COPYSVALUE(VALUE$PTR,ASSBLOCKSPTR); 

NOSEXSVALUE=TRUE; 

FI 

AS$CH#PTR=ASSBLOCKSPTR+2; 

/* RESET NEUTRAL STACK TO EMPTY RELEASING THE ASSOCIATED BLOCKS */ 
NSSSTACKSINDEX=0; 

DO NEXTSARG; 

CALL FREESCHAIN(ARGSPTR); 

ENDDO 

NSSSTACKSINDEX=0; 

ENDPROCEDURE ASSNSSINIT; 


Number 23 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 31 

133 



00832 1 

00833 2 

00834 2 

00835 2 

00836 2 

00837 2 

00838 1 

00839 1 

00840 2 

00841 2 

00842 2 

00843 2 

00844 2 

00845 2 

00846 2 

00847 2 

00848 2 

00849 3 

00850 3 

00851 4 

00852 4 

00853 5 

00854 4 

00855 3 

00856 3 

00857 2 

00858 2 

00859 2 

00860 2 
00861 2 
00862 3 

00863 3 

00864 2 

00865 2 

00866 1 
00867 1 

00868 2 
00869 2 

00870 2 

00871 2 

00872 2 

00873 2 

00874 2 

00875 2 

00876 2 

00877 3 

00878 3 

00879 2 

00880 1 
00881 1 
00882 2 
00883 2 

00884 2 

00885 2 

00886 2 
00887 2 

00888 2 
00889 2 

00890 3 

00891 3 

00892 2 

00893 3 

00894 3 

00895 4 

00896 4 

00897 4 

00898 3 

00899 2 

00900 1 

00901 1 

00902 2 

00903 2 

00904 2 

00905 2 

00906 2 

00907 2 

00908 3 

00909 4 

00910 4 

00911 3 

00912 5 

00913 5 

00914 4 

00915 4 

00916 3 

00917 3 

00918 2 

00919 1 


AS*FREE$BL0CK: PROCEDURE; 

TEMPSPTR=ASSBLOCKSPTR; 

ASSBLOCKSPTR=ASSBLOCK; 

CALL FSSFREE(TEMPSPTR); 

ASSCHSPTR*ASSBLOCKSPTR+2; 

ENDPROCEDURE ASSFREESBLOCK; 

ASSNEXTSCH: FUNCTI ON(MOVESPTRSFLAO) BYTE: 

/* RETURN THE NEXT 7-BIT CHARACTER FROM THE ACTIVE STRING */ 

/* ASSCHSPTR IS THE ADDRESS OF THE NEXT CHAR TO BE RETURNED */ 

/* OR JUST OFF THE END OF A BLOCK */ 

/* PAST CHARACTERS ARE REPLACED WITH 'PHI' (8-BIT NULL)*/ 

DECLARE 

(MOVESPTRSFLAG,CH) BYTE, 

OLDSBLOCKSPTR ADDRESS; 

NEXT: FUNCTION BYTE: 

IF (LOW(ASSCHSPTR) AND NOTSPTRSMASK) * 0 THEN DO; 

CALL ASSFREESBLOCK: 

IF HIGH(ASSBLOCKSPTR) = 0 THEN DO; 

GO TO START; 

FI 

FI 

RETURN ASSCH; 

ENDFUNCTI ON NEXT; 

/* SKIP ANY 8-BIT CHARACTERS */ 

DO WHILE ROL(CH:=NEXT,1); ASSCHSPTR=ASSCHSPTR+1; ENDDO 
IF MOVESPTRSFLAG THEN DO; 

AS$CH=PHI; 

ASSCHSPTR = ASSCHSPTR+1; 

FI 

PFTIIRN PH * 

ENDFUNCTI6n ASSNEXTSCH; 

STARTSNEXTSARGUMENT: PROCEDURE(FLAGS); 

/* INITIALIZE THE NEXT NEUTRAL STRING STACK ENTRY TO THE NULL STRING */ 
/* ALSO SET FLAGS WHICH INDICATE ACTIVE OR NEUTRAL MODE */ 

DECLARE FLAGS BYTE; 

NSSSTACK(NSSSTACKSINDEX:=NSSSTACKSINDEX+1),NS$CH$PTR=FS$GET OR FLAGS; 
NSSCHSPTR*(NSSCHSPTR AND PTR$MASK)+2; 

NSSARGSBREAK=FALSE; 

IF NSSSTACKSINDEX=LAST(NSSSTACK)-4 THEN DO; 

CALL M0N1(9,.'NS STACK OVERFLOW S'); 

GO TO BDOS; 

FI 

ENDPROCEDURE STARTSNEXTSARGUMENT; 

NSSADDSCH: PROCEDURE(CH): 

/* APPEND CH TO THE ACTIVE STRING. IF NSSARGSBREAK IS FALSE, THEN */ 

/* NSSCHSPTR IS THE ADDRESS OF THE NEXT CHARACTER TO BE ADDED */ 

DECLARE 

CH BYTE, 

(BLOCKSPTR,BLOCK BASED BLOCKSPTR) ADDRESS; 

IF NSSARGSBREAK THEN DO: 

NSSCHSPTR=APPENDSCH(CH,NSSSTACK(NSSSTACKSINDEX) AND PTRSMASK); 
NSSARG$BREAK=FALSE; 

END; ELSE DO; 

NS$CH= CH * 

IF(LOW(NSSCHSPTR:=NSSCH$PTR+1) AND NOTSPTRSMASK) = 0 THEN DO; 
BLOCK$PTR = NSSCHSPTR-BLOCKSLENGTH; 

BLOCK,NS$CHSPTR=FSSGET; 

NSSCHSPTR = NSSCHSPTR + 2; 

FI 

FI 

ENDPROCEDURE NSSADDSCH; 

PROCESSSQUOTEDSSTRING: PROCEDURE: 

DECLARE (DEL IMSLEVEL,LASTSDELIMSWASSLEFT,CH) BYTE; 


DEL IMSLEVEL*0: 

LASTSDELIMSWASSLEFT=TRUE; 

DO FOREVER; 

IF (CH:=ASSNEXTSCH(MOVESPTR)) = LEFTSDELIM THEN DO: 

IF LASTSDELIMSWASSLEFT THEN DO; DEL IMSLEVEL*DELIMSLEVEL+1 ; FI 
LASTSDELIMSWASSLEFT* TRUE: 

END: ELSE IF CH = RIGHTSDELIM THEN DO: 

IF LASTSDELIMSWASSLEFT THEN DO; LASTSDELIMSWASSLEFT=FALSE; 
END; ELSE DO; DELIMSLEVEL=DELIMSLEVEL-1 ; 

IF DEL IMSLEVEL = 0 THEN DO; RETURN; FI 
FI 

CALL NSSADDSCH(CH); 

ENDDO 

ENDPROCEDURE PROCESSSQUOTEDSSTRING; 



Page 32 

134 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 23 



00920 

1 

00921 

2 

00922 

2 

00320 

2 

00924 

2 

00925 

2 

00326 

2 

00927 

3 

00928 

3 

00929 

4 

00930 

4 

00931 

3 

00932 

4 

00933 

4 

00934 

3 

00935 

2 

00936 

3 

00937 

3 

00938 

2 

00939 

3 

00940 

2 

00941 

1 

00942 

1 

00943 

1 

00944 

1 

00945 

1 

00946 

2 

00947 

2 

00948 

2 

00949 

2 

00950 

2 

00951 

2 

00952 

2 

00953 

2 

00954 

2 

00955 

2 

00956 

3 

00957 

3 

00958 

2 

00959 

3 

00960 

3 

00961 

2 

00962 

2 

00963 

2 

00964 

3 

00965 

3 

00966 

3 

00967 

2 

00968 

2 

00969 

2 

00970 

2 

00971 

2 

00972 

2 

00973 

3 

00974 

2 

00975 

1 

00976 

1 

00977 

2 

00978 

2 

00979 

2 

00980 

2 

00981 

2 

00982 

2 

00983 

2 

00984 

2 

00985 

3 

00986 

4 

00987 

3 

00988 

4 

00989 

3 

00990 

2 

00991 

2 

00992 

2 

00993 

1 

00994 

1 

00995 

2 

00996 

2 

00997 

2 

00998 

2 

00999 

2 

01000 

1 

01001 

1 

01 002 

2 

01 003 

2 

01 004 

2 

01 005 

2 

01 006 

1 


Number 23 


PROCESSSBEG!NSFUNCTION: PROCEDURE; 

DECLARE 

BLOCKSPTR ADDRESSj 

(BLOCK BASED BLOCKSPTR,CH) BYTE; 

IF (CH:=AS$NEXT$CHCDONTSMOVESPTR)) = FUNSCH THEN DO; 

DUMMY = ASSNEXT®CH(MOVESPTR); 

IF (CH:=AS$NEXTSCH(DONTSMOVESPTR)) = LEFTSDELIM THEN DO; /* NEUTRAL */ 
DUMMY =ASSNEXTSCH(MOVESPTR); 

CALL STARTSNEXTSARGUMENT(NSSFUNSBIT); 

END; ELSE DO; /* NOT A FUNCTION, JUST TWO FUN CHARACTERS */ 

CALL NSSADDSCH(FUNSCH); 

CALL NSSADDSCH(FUNSCH); 

END^ELSE IF CH = LEFTSDELIM THEN DO; /* ACTIVE FUNCTION CALL */ 
6uMMY=ASSNEXTSCH(MOVESPTR); 

CALL STARTSNEXTSARGUMENTCNSSFUNSBIT OR NSSACTIVESBIT); 

END: ELSE DO; /* NOT A FUNCTION, JUST ONE FUN CHARACTER */ 

CALL NS$ADDSCH(FUNSCH); 

FI 

ENDPROCEDURE PROCESSSBEGINSFUNCTI ON; 


/*** UTILITIES FOR PRIMITIVE FUNCTIONS ***/ 

BINARYSTOSSTRING: PROCEDURE!N); 

/« NOTE: VALUESPTR IS USED BY PROCESSSENDSFUNCTI ON */ 
DECLARE 

N ADDRESS, 

D(6) BYTE, 

(I,K,NEGATIVE) BYTE; 

NEGATIVE=FALSE; 

I = -1 ; 

IF ROLCHIGH(N),1) THEN DO; 

NEGATIVE=TRUE; 

N=-N: 

END; ELSE IF N = 0 THEN DO; 

I =0; 

D ( 0) = ' 0' ; 


DO WHILE N > 0; 

1=1+1; 

D ( I ) = (N MOD 10) + '0'; 

N=N/10; 

ENDDO 

IF NEGATIVE THEN DO; 1=1+1; D(I)='-'; FI 

VALUE$PTR=FS$GET; 

FIRSTSPUTASFLAG=TRUE; 

FOR K=0 TO I; 

CALL PUT$CHA(VALUESPTR,D(I-K)); 

ENDFOR 

ENDPROCEDURE BINARYSTOSSTRING; 

STRINGSTOSBINARY: FUNCTI ONCBLOCKSPTR) ADDRESS; 

DECLARE 

(BLOCKSPTR,N) ADDRESS, 

(CH,NEGATIVE) BYTE; 

N,NEGATIVE=0; 

FIRST$GETA$FLAG=TRUE; 

DO WHILE (CH:=GET$CHA(BLOCKSPTR AND PTRSMASK)) <> NIL; 

IF CH = 'THEN DO; 

NEGATIVE=TRUE; 

END; ELSE IF (CH:=CH-'0') < 10 THEN DO; 

N=SHL(N,3)+N+N+CH; 

FI 

ENDDO 

IF NEGATIVE THEN DO; RETURN -N; FI 
RETURN N; 

ENDFUNCTI ON STRINGSTOSBtNARY; 

CHSTOSHEX: FUNCTION(CH) BYTE; 

DECLARE CH BYTE; 

IF CH <= '9' THEN DO; RETURN CH-'O'; FI 

IF CH < 47H THEN DO; RETURN CH-37H; FI /* CH-'A'+IO */ 
RETURN CH-57H; /* LOWER CASE A-F */ 

ENDFUNCTI ON CHSTOSHEX; 

HEXSTOSCH: FUNCTI ON(HALFSBYTE) BYTE; 

DECLARE HALFSBYTE BYTE; 

IF HALFSBYTE < 10 THEN DO; RETURN HALFSBYTE+'O'; FI 
RETURN HALFSBYTE+57H; /* 57H = 'A'-10 (LOWER CASE A-F) */ 
ENDFUNCTI ON HEXSTOSCH; 



Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 33 

135 



01007 1 

01008 2 
01009 2 

01010 2 
01011 2 
01012 2 
01013 2 

01014 2 

01015 1 

01016 1 
01017 2 

01018 2 
01019 2 

01020 2 
01021 2 
01022 2 
01023 2 

01024 2 

01025 2 

01026 2 
01027 3 

01028 3 

01029 3 

01030 3 

01031 4 

01032 5 

01033 4 

01034 4 

01035 4 

01036 5 

01037 4 

01038 4 

01039 3 

01040 2 

01041 2 

01042 3 

01043 3 

01044 3 

01045 3 

01046 4 

01047 4 

01048 5 

01049 4 

01050 5 

01051 4 

01052 3 

01053 2 

01054 2 

01055 2 

01056 2 

01057 2 

01058 3 

01059 3 

01060 4 

01061 4 

01062 4 

01063 3 

01064 3 

01065 3 

01066 3 

01067 2 

01068 1 
01069 1 

01070 1 

01071 1 

01072 1 

01073 1 

01074 1 

01075 1 

01076 2 

01077 2 

01078 2 

01079 2 

01080 2 
01081 3 

01082 3 

01083 4 

01084 4 

01085 3 

01086 4 

01087 4 

01088 3 

01089 2 

01090 1 


Page 34 

136 


NUMBERSOFSARGS: FUNCTION BYTE: 

/* COUNT THE NUMBER OF ARGS FOR THE CURRENT FUNCTION */ 

DECLARE N BYTE; 

N= 1 ; 

DO NEXTSARG' N=N+1; ENDDO 
NSSSTACKSINDEX = NSSSAVESINDEX; 

RETURN N: 

ENDFUNCTI ON NUMBERSOFSARGS; 

SSSMATCH: FUNCTION BYTE; 

/* SUBSTRING MATCH TEST FOR SS, IN */ 

/* IMPLICIT INPUT: SSSCHASPTR (START SEARCH HERE), ARGSPTR (SUBSTRING) */ 
/* IMPLICIT OUTPUT: SSSCHBSPTR, SSSCHCSPTR (BOUNDS OF MATCHED SUBSTRING) */ 
/* SSSCHBSPTR IS THE CHAR BEFORE THE FIRST MATCHED CHARACTER */ 

/* SSSCHCSPTR IS THE LAST CHARACTER OF THE MATCH */ 

DECLARE 

(CHA.CHB) BYTE, 

RESTARTSPTR ADDRESS; 

MATCHSHERE: FUNCTION BYTE; 

FIRST$GETB$FLAG=TRUE; 

DO FOREVER; 

/* GET NEXT 7-BIT CHAR FROM SUBSTRING. IF NIL THEN HAVE MATCHED */ 

DO WHILE R0L(CHB:=GETSCHB(ARGSPTR>,1); 

IF CHB = NIL THEN DO; RETURN TRUE; FI 
ENDDO 

/* GET NEXT 7-BIT CHAR FROM STRING. FAIL IF FIND 8-BIT <> PHI */ 

DO WHILE ROLtCHA:=GET*CHA(0),1); 

IF CHA <> PHI THEN DO; RETURN FALSE; FI 
ENDDO 

IF CHA <> CHB THEN DO; RETURN FALSE; FI 
ENDDO 

ENDFUNCTION MATCHSHERE; 

NEXTSSTART: FUNCTION BYTE: 

GETSCHASCHSPTR=RESTARTSPTR; 

DUMMY = GETSCHA(0); 

DO FOREVER: 

RESTARTSPTR=GETSCHASCHSPTR: 

IF ROL(CHA:=GETSCHA(0).1) THEN DO; 

IF CHA = NIL THEN DO; RETURN FALSE; FI 
END; ELSE DO: 

RETURN TRUE; 

FI 

ENDDO 

ENDFUNCTION NEXTSSTART; 

RESTART$PTR=SS$CHASPTR; 

IF NULLSTEST(ARGSPTR) THEN DO; RETURN FALSE; FI 
DO FOREVER; 

GETSCHASCHSPTR=RESTARTSPTR; 

IF MATCHSHERE THEN DO; 

SSSCHBSPTR=RESTARTSPTR; 

SSSCHCSPTR 3 GETSCHASCHSPTR; 

RETURN TRUE; 

FI 

IF CHA = NIL THEN DO; RETURN FALSE; FI 
/* RESTART AT THE NEXT 7-BIT CHAR */ 

IF NOT NEXTSSTART THEN DO; RETURN FALSE; FI 
ENDDO 

ENDFUNCTI ON SSSMATCH; 


/*** PRIMITIVE FUNCTIONS AND PROCESSSENDSFUNCTI ON ***/ 

/* FUNCTIONS ARE ENTERED WITH NSSSTACKSINDEX CORRESPONDING TO FIRST ARGUMENT */ 
/* VALUESPTR IS PRESET TO NULLSSTRINGSPTR FOR DEFAULT VALUE */ 

PFSNS: PROCEDURE; 

/* 'NAME STRING' S(NS,NAME,VALUE.NAME,VALUE,...) */ 

/* REUSES ANY EXISTING SYMBOL TABLE ENtRIES */ 

DO NEXTSARG; „ 

IF NOT st$FIND(ARGSPTR) THEN DO; CALL STSCREATE(ARGSPTR); FI 
IF (ARGSPTR:=NEXTSNS) THEN DO; 

CALL STSADDSVALUE(FSSGET); /* SUPPLY NULL VALUE IF NO ARGUMENT */ 
RETURN; 

END: ELSE DO; 

6ALL STSADDSVALUECARGSPTR); 

NSSSTACK(NSSSTACKSINDEX)=NULLSSTRINGSPTR; /*S0 WON'T FREE VALUE*/ 

FI 

ENDDO 

ENDPROCEDURE PFSNS; 



Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 23 





01091 
01092 
01093 
01094 
01095 
01096 
01097 
0109S 
01099 
01100 
01 1 01 
01102 
01103 
01104 
01 105 
01 1 06 
01107 
01 1 08 
01109 
01 1 1 o 
01111 
01112 
01113 
01114 
01115 
01116 
01117 
01118 
01119 
01120 
01 121 
01 122 
01 123 
01 124 
01125 
01 126 
01 127 
01 128 
01 1 29 
01 1 30 
01 1 31 
01 1 32 
01 1 33 
01 134 
01 135 
01136 
01 137 
01 138 
01 1 39 
01 1 40 
01 1 41 
01 1 42 
01 1 43 
01 1 44 
01 1 45 
01 146 
01 1 47 
01 148 
01 149 
01 150 
01 151 
01 152 
01 153 
01 154 
01 1 55 
01 1 56 
01 1 57 
01 1 58 
01 1 59 
01 1 60 
01 1 61 
01 1 62 
01 1 63 
01 1 64 
01 1 65 
01 1 66 
01 1 67 
01 1 68 
01 1 69 
01 1 70 
01 1 71 
01 1 72 
01 1 73 
01 174 
01 1 75 
01 1 76 
01 1 77 
01 1 78 
01 1 79 
01 1 80 
01181 
01 1 82 
01 1 83 


1 

2 

2 

2 

2 

2 

3 

4 
4 
3 
3 
3 
3 
3 

3 

4 

4 

4 

4 

5 
4 
3 
2 
1 
1 
1 
2 
2 
2 
2 
2 
3 
3 
3 
3 
3 
3 
3 
3 
3 

3 

4 
4 
3 
2 
2 
2 
2 
2 
3 
3 

3 

4 
4 
4 
4 
4 

4 

5 
5 
4 
4 
3 
2 
1 
1 

2 

2 

2 

2 

2 

2 

2 

2 

2 

3 

3 

3 

3 

2 

2 

2 

3 

3 

3 

3 

3 

3 

3 

4 
3 
3 
2 


PFSAS: PROCEDURE; 

/* 'APPEND TO STRING' 
DECLARE CH BYTE; 


S(AS,NAME.SUFFIX,NAME,SUFFIX,...) */ 


DO NEXTSARG; 

IF NOT STSFIND(ARGSPTR) THEN DO; 

CALL ST$CREATE(ARGSPTR): 

CALL STSADDSVALUE C FSSGET); 

FI 

IF LOWCARGSPTR:=NEXTSNS) THEN DO; RETURN; FI 
FIRST$GETA$FLAG=TRUE; 

IF (CHI=GET$CHA(ARGSPTR)) <> NIL THEN DO: 

PUTSCHASCHSPTR=APPENDSCH(CH,STSENTRY(STSVALUESINDEX)); 

PUTSCHASCURRENT$BLOCKSPTR=PUTSCHASCHSPTR AND PTRSMASK; 

FIRSTSPUTASFLA0=FALSE; 

DO WHILE (CH:=GETSCHA(0)) <> NIL; 

CALL PUTSCHA(0,CH); 

ENDDO 

FI 

ENDDO 

ENDPROCEDURE PFSAS; 

PFSSS: PROCEDURE; 

/* 'SEGMENT STRING' S(SS,NAME,ARG,ARG,...) */ 

/* NO MORE THAN 64 ARGS */ 

DECLARE (ARGSNUMBER,MORESFILL) BYTE; 

PUTSCHASSS: PROCEDURE(CHA); 

/* SPECIAL PUTSCHA FOR SEGMENT STRING */ 

DECLARE 

(CH BASED PUTSCHASCHSPTR,CHA) BYTE, 

CURRENTSBLOCKSPTR ADDRESS. 

CURRENTSBLOCK BASED CURRENTSBLOCKSPTR ADDRESS; 

CH=CHA; 

IF (LOW(PUTSCHASCHSPTR:=PUTSCHA$CHSPTR+1) AND NOTSPTRSMASK) 

= 0 THEN DO; 

CURRENTSBLOCKSPTR = PUTSCHASCHSPTR-BLOCKSLENGTH; 
PUT$CHASCHSPTR=CURRENTSBL0CK+2; 

FI 

ENDPROCEDURE PUTSCHASSS; 

IF NOT STSFIND(NEXTSNS) THEN DO; RETURN; FI 
ARG$NUMBER=-1; 

DO NEXTSARG; 

ARGSNUMBER = ARGSNUMBER+1 ; 

SSSCHASPTR = STSENTRY(STSVALUESINDEX) +1 ; 

DO WHILE SSSMATCH; 

GET$CHASCHSPTR=SSSCHBSPTR; 

DUMMY = GETSCHA(0) ; 

PUTSCHASCHSPTR=GETSCHASCHSPTR; 

MORESFILL=(PUTSCHASCHSPTR <> SSSCHCSPTR); 

CALL PUTSCHASSS(SSSMASK OR ARGSNUMBER); /* INSERT SEG. NUM. 

DO WHILE MORESFILL; 

MORESFILL=(PUTSCHASCHSPTR <> SSSCHCSPTR); 

CALL PUTSCHASSS(PH I); 

ENDDO 

SSSCHASPTR=SSSCHCSPTR; 

ENDDO 

ENDDO 

ENDPROCEDURE PFSSS; 

PFSGC: PROCEDURE; 

/* 'GET CHARACTERS' $(GC,NAME,N,S,F) */ 

/* IF ONLY TWO ARGS, VALUE IS LENGTH OF THE NAMED STRING */ 

/* IF NO FORM CALLED NAME, THEN VALUE IS NULL */ 

DECLARE 

(GCSPTR,NSPTR.N,MARKSPTR,FORMSPTR, 

CURRENTSCHSPTR,BACKUPSTO) ADDRESS, 

(CH,NEGSCOUNTSFAILED) BYTE; 


ANOTHERSCH: FUNCTION BYTE; 

IF N = 0 THEN DO; RETURN FALSE; FI 
IF (CH:=GETSCHA(0)) <> NIL THEN DO; 
RETURN FALSE: 

ENDFUNCTI ON ANOTHERSCH; 


RETURN TRUE; FI 


GCSLENGTH: FUNCTION ADDRESS; 

DECLARE M ADDRESS; 

M = 0: 

FIRSTSGETASFLAG=TRUE; 

TEMPSPTR=STSENTRY(STSVALUESINDEX); 

DO WHILE (CH:=GETSCHA(TEMPSPTR)) <> NIL AND 
GETSCHASCHSPTR <> MARKSPTR; 

IF NOT ROL(CH,1) THEN DO; M=M+1; FI 
ENDDO 
RETURN M; 

ENDFUNCTI ON GCSLENGTH; 


Number 23 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


*/ 


Page 35 

137 


01184 2 

01185 2 

01186 2 
01187 2 

01188 2 
01189 2 

01190 2 

01191 2 

01192 2 

01193 2 

01194 2 

01195 3 

01196 3 

01197 3 

01198 2 

01199 2 

01200 2 
01201 2 
01202 2 
01203 2 

01204 2 

01205 2 

01206 3 

01207 4 

01208 4 

01209 4 

01210 3 

01211 2 
01212 2 
01213 2 

01214 2 

01215 2 

01216 2 
01217 3 

01218 2 
01219 1 

01220 1 
01221 2 
01222 2 
01223 2 

01224 2 

01225 2 

01226 2 
01227 2 

01228 2 
01229 2 

01230 2 

01231 2 

01232 2 

01233 2 

01234 2 

01235 2 

01236 2 

01237 2 

01238 2 

01239 2 

01240 3 

01241 3 

01242 4 

01243 3 

01244 3 

01245 2 

01246 3 

01247 3 

01248 3 

01249 4 

01250 5 

01251 5 

01252 4 

01253 3 

01254 2 

01255 2 

01256 2 

01257 3 

01258 2 

01259 1 

01260 1 
01261 2 
01262 2 
01263 2 

01264 2 

01265 1 


IF NOT STSFIND(.ATSGC) THEN DO: CALL STSCREATE(.AT*GC); FI 
CALL ST$AD0$VALUE!GCSPTR:=FS$GET); 

NAME$PTR=NEXT$NS; 

N$PTR=NEXT$NS; 

SSPTR=NEXT$NS; 

F$PTR=NEXTSNS; 

IF NOT STSFIND(NAMESPTR) THEN DO; RETURN; FI 

IF LOW(NSPTR) THEN DO; /* RETURN STRING LENGTH IF NO THIRD ARGUMENT */ 
MARK$PTR=0; 

CALL BINARVSTOSSTRING(GCSLENGTH); 

RETURN; 

FI 

N=STRINGSTOSBI NARY(NSPTR); 

NEGSCOUNTSFAI LED=>FALSE; 

GETSCHASCHSPTR, FORMSPTR=STSENTRY(STSCHSPTRSINDEX); 

/* NEGATIVE COUNT NOT IMPLEMENTED */ 

FIRSTSPUTASFLAG-TRUE; 

DO WHILE ANOTHERSCH; 

IF NOT ROL(CH,1) THEN DO; 

N = n-1 * 

FORMSl^TR 3 GETSCHASCHSPTR; 

CALL PUTSCHACGCSPTR,CH); 


FI 

ENDDO 

STSENTRY(STSCHSPTRSINDEX)=FORMSPTR; 

VALUESPTR®SSPTR; 

IF N <> 0 OR NEGSCOUNTSFAI LED THEN DO; VALUESPTR = FSPTR: FI 
IF LOW(SSPTR) THEN DO; /* RETURN SGC IF NO S OR F ARGS */ 

CALL COPYSVALUECGCSPTR,VALUESPTR:=FSSGET); 

FI 

ENDPROCEDURE PFSGC; 

PFSIN! PROCEDURE; 

/* 'INITIAL' S(IN,NAME,SUBSTRING,S,F) SIN SET TO 'VALUE' */ 

/* ADD... IF SUBSTRING IS NULL, THEN LOOK FOR THE NEXT NON-NULL SEGMENT */ 
DECLARE INSPTR ADDRESS, CH BYTE; 

NAMESPTR=NEXTSNS; 

ARGSPTR=NEXTSNS; /* USED BY SSSMATCH */ 

SSPTR=NEXTSNS; 

FSPTR,VALUESPTR=NEXTSNS; 

IF NOT STSFIND(.ATS IN) THEN DO; CALL STSCREATE(.ATS 1N); FI 
CALL STSADDSVALUE(INSPTR:=FSSGET); 

IF NOT STSFIND(NAMESPTR) THEN DO; RETURN; FI 
SSSCHASPTR=STSENTRY(STSCHSPTRSINDEX); 

FIRSTSGETASFLAG® FALSE; 

FIRSTSPUTASFLAG®TRUE; 

IF SSSMATCH THEN DO: 

GETSCHASCHSPTR®SSSCHASPTR; 

DO WHILE GETSCHASCHSPTR <> SSSCHBSPTR: 

IF NOT ROL(CH:=GETSCHA(0),1) THEN DO; CALL PUTSCHAIINSPTR,CH); FI 
ENDDO 

VALUESPTR=SSPTR; 

END: ELSE DO; 

GETSCHASCHSPTR.SSSCHCSPTR=SSSCHASPTR; 

FIRSTSPUTASFLAG=TRUE; 

DO WHILE (CH:=GETSCHACO)) <> NIL; 

IF NOT ROL(CH,1) THEN DO; 

SSSCHC$PTR=GETSCHASCHSPTR,• 

CALL PUTSCHA(INSPTR, CH); 

ENDDO 


FI 

STSENTRY(STSCHSPTRSINDEX)=SSSCHCSPTR; 

IF LOW(SSPTR) THEN DO: /* RETURN SIN IF NO S OR F ARGS */ 
CALL COPYSVALUE(INSPTR,VALUESPTR:=FS$GET); 

FI 

ENDPROCEDURE PFSIN; 


PFSCR: PROCEDURE; 

/* 'CALL RESTORE' S(CR,NAME) */ 

IF NOT STSFIND(NEXTSNS) THEN DO; RETURN; FI 

InDPROCEDURE C PFSCR?‘ NDEX ’ =ST$EN tRY ‘STSVALUESINDEX)♦1 ; 



138 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 23 


01266 1 
01267 2 

01268 2 
01269 2 

01270 2 

01271 2 

01272 2 

01273 2 

01274 2 

01275 3 

01276 3 

01277 4 

01278 4 

01279 3 

01280 4 

01281 4 

01282 3 

01283 2 

01284 1 

01285 1 

01286 2 
01287 2 

01288 2 
01289 2 

01290 2 

01291 2 

01292 2 

01293 1 

01294 1 

01295 2 

01296 2 

01297 2 

01298 2 

01299 2 

01300 2 

01301 2 

01302 3 

01303 4 

01304 3 

01305 2 

01306 1 

01307 1 

01308 2 

01309 2 

01310 2 

01311 2 

01312 2 

01313 2 

01314 2 

01315 2 

01316 2 

01317 2 

01318 2 

01319 £*" 

01320 2 

01321 2 

01322 3 

01323 4 

01324 3 

01325 4 

01326 5 

01327 5 

01328 5 

01329 6 

01330 5 

01331 4 

01332 3 

01333 2 

01334 1 

01335 1 

01336 2 

01337 2 

01338 2 

01339 2 

01340 2 

01341 1 

01342 1 

01343 2 

01344 2 

01345 2 

01346 2 

01347 2 

01348 3 

01349 3 

01350 3 

01351 2 

01352 1 

01353 1 

01354 2 

01355 2 

01356 2 

01357 1 


Number 23 


PFSEQ: PROCEDURE; 

/* 'EQUAL' $(EQ,A, 6,0, B,C,...,B,C) */ 

/* OR $(EQ,A, B,C, B,C,...,B) */ 

DECLARE 

CARGA,ARGB,ARGC) ADDRESS; 

ARGA=NEXTSNS; 

DO FOREVER; 

IF L0W(ARGB:=NEXT$NS) THEN DO; RETURN; FI 
IF LOWCARGC:=NEXT$NS) THEN DO; 

VALUE$PTR=ARGB; 

RETURN; 

END; ELSE IF STRINGSEQUALITY(ARGA,ARGB) THEN DO; 

VALUESPTR=ARGC; 

RETURN; 

FI 

ENDDO 

ENDPROCEDURE PFSEQ; 

PFSGE! PROCEDURE; 

/* 'GREATER THAN OR EQUAL TO' $(GE,N,M,S,F) */ 

/* '+8000H' IS TO MAP SIGNED HALF-RANGE ONTO FULL-RANGE INTEGERS */ 

IF STRINGSTOSBI NARY(NEXTSNS)+8000H >= STR1NGSTOSBI NARY(NEXTSNS) +8000H 
THEN DO; VALUESPTR^NEXTSNS; RETURN; FI 
VALUE$PTR=NEXTSNS; 

VALUE$PTR=NEXTSNS: 

ENDPROCEDURE PFSGE; 

PFSNT: PROCEDURE; 

/* 'NULL TEST' S(NT,NAME,S,F) */ 

NAMESPTR=NEXTSNS AND PTRSMASK; 

SSPTR,VALUESPTR=NEXTSNS; 

FSPTR=NEXTSNS; 

IF STSFIND(NAMESPTR) THEN DO; 

IF NOT NULL$TEST(STSENTRY(STSVALUESINDEX)) THEN DO; 

- VALUESPTR = FSPTR; 

FI 

FI 

ENDPROCEDURE PFSNT; 

PFSCL: PROCEDURE(STACKSOFFSET); 

/* 'CALL' S(CL,NAME,ARG,ARG,...) OR S(NAME,ARG,ARG,...) */ 

DECLARE 

STACKSOFFSET BYTE, /* 0 IF FIRST ARG IS 'CL' -1 OTHERWISE */ 
LASTSARGSNUMBER BYTE. /* ARG(1ARG(LASTSARGSNUMBER) */ 

(CH,CHB,SEGSNUMBER) BYTE; 

LASTSARG$NUMBER=NUMBER$OFSARGS-STACKSOFFSET-2; 

NSSSTACKSINDEX=NSSSTACKSINDEX+STACKSOFFSET; 

IF NOT STSFIND(NEXTSNS AND PTRSMASK) THEN DO; RETURN; FI 
VALUESPTR= FSSGET; 

FIRSTSGETASFLAG,FIRSTSPUTASFLAG=TRUE; 

TEMPSPTR=STSENTRY(STSVALUESINDEX); 

DO WHILE (CH:=GETSCHA(TEMPSPTR)) <> NIL; 

IF NOT ROL(CH,1) THEN DO; 

CALL PUTSCHA(VALUESPTR.CH); 

END; ELSE IF R0L(CH,2) THEN DO; 

IF (SEGSNUMBER:=(CH XOR SS$MASK)+1) <= LASTSARGSNUMBER THEN DO; 
TEMPSPTR=NS$STACK(NSSSTACKSINDEX+SEGSNUMBER); 

FIRST$GETB$FLAG=TRUE; 

DO WHILE (CHB:=GETSCHB(TEMPSPTR)) <> NIL; 

IF NOT ROL(CHB,1) THEN DO; CALL PUTSCHA(VALUESPTR,CHB); FI 
ENDDO 
FI 
FI 

ENDDO 

ENDPROCEDURE PFSCL; 

PFSEX: PROCEDURE: 

/* 'EXIT' S(EX,DO-THIS) */ 

VALUESPTR=NEXTSNS; 

NOSEXSVALUE=NULL$TEST(VALUESPTR); 

GO TO START; 

ENDPROCEDURE PFSEX; 

PFSPS: PROCEDURE; 

/* 'PRINT STRING' $(PS,ARG,ARG,...) */ 

DECLARE NOTSFIRST BYTE; 

NOTSF1RST = FALSE; 

DO NEXTSARG; 

IF NOTSFIRST THEN DO; CALL CRLF; FI 
NOTSFIRST = TRUE; 

CALL PRINTSSTRING(ARGSPTR); 

ENDDO 

ENDPROCEDURE PFSPS; 

PFSFW: PROCEDURE; 

/* 'FORM WIDTH $(FW,CH-PER-LINE) */ 

C0NSW1DTH = STRINGSTOSBI NARY(NEXTSNS); 

ENDPROCEDURE PFSFW; 



Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


01358 1 

01359 2 

01360 2 

01361 2 

01362 2 

01363 2 

01364 2 

01365 2 

01366 3 

01367 3 

01368 4 

01369 4 

01370 5 

01371 5 

01372 5 

01373 4 

01374 3 

01375 3 

01376 3 

01377 2 

01378 2 

01379 2 

01380 2 

01381 2 

01382 3 

01383 4 

01384 3 

01385 3 

01386 3 

01387 3 

01388 3 

01389 4 

01390 3 

01391 2 

01392 3 

01393 3 

01394 4 

01395 4 

01396 4 

01397 4 

01398 5 

01399 4 

01400 5 

01401 4 

01402 3 

01403 2 

01404 1 

01405 1 

01406 2 

01407 2 

01408 2 

01409 2 

01410 2 

01411 2 

01412 2 

01413 2 

01414 2 

01415 2 

01416 3 

01417 3 

01418 3 

01419 3 

01420 2 

01421 1 

01422 1 

01423 2 

01424 2 

01425 2 

01426 2 

01427 2 

01428 2 

01429 2 

01430 2 

01431 3 

01432 3 

01433 2 

01434 1 

01435 1 

01436 2 

01437 2 

01438 2 


PF$RS: PROCEDURE; 

/* 'READ STRING' SCRS.PROMPT) */ 

/* INPUT FROM CONSOLE OR DISK */ 

DECLARE 

(K.CH) BYTE, 

NOTSCOMMENT BYTE; 

NEXTSCHAR: PROCEDURE; 

IF TBUFFSINDEX = 128 THEN DO; 

TBUFFSINDEX=0; 

IF M0N2( 20, .TFCB) <> 0 THEN DO; 

CALL PRINT$MESS(.'DISK EOF $'); 
CH=END$OF$FILE; 

RETURN; 

FI 


FI 

CH = TBUFF(TBUFFSINDEX); 

TBUFFSINDEX=TBUFFSINDEX+1; 

ENDPROCEDURE NEXTSCHAR; 

VALUESPTR=FS$GET; 

FIRSTSPUTASFLAG=TRUE; 

IF CONS IN THEN DO; 

IF NOT LOWCARGSPTR:=NEXTSNS) THEN DO; 

CALL PRINTSSTRINGCARGSPTR); 

FI 

CALL MON1(10,.CONBUF); 

CALL CRLF; 

K= 1 ; 

DO WHILE K <= CONBUF Cl); 

CALL PUTSCHACVALUESPTR,CONBUF(K:= K+1)); 

ENDDO 

END: ELSE DO; /* DISK INPUT. */ 

NOTSCOMMENT=TRUE; 

DO FOREVER; 

CALL NEXTSCHAR; 

IF CH = METASCHAR THEN DO; RETURN; FI 

IF CH = ENDSOFSFILE THEN DO; C0NS1N=TRUE; RETURN; FI 

IF CH = COMMSDELIM THEN DO: 

NOTSCOMMENT = NOT NOTSCOMMENT; 

END; ELSE IF CH >= ' ' AND NOTSCOMMENT THEN DO; 

CALL PUTSCHACVALUESPTR,CH); 

ENDDO 



FI 

ENDPROCEDURE PFSRS; 

PFSPK: PROCEDURE; 

/* 'PACK' HEX-TO-ASCII $(PK,HEX-STRING) #/ 

/* ALSO CALLED FROM PFSRO */ 

DECLARE (CHA,CHB) BYTE; 

VALUESPTRaFSSGET; 

TEMPSPTR=NEXT$NS; 

FIRSTSGETASFLAG,FIRSTSPUTASFLAG^TRUE; 

DO FOREVER; 

/* NOTE: ASSUMES NO 8-BIT CHARACTERS OTHER THAN NIL */ 
CHA*GETSCHA(TEMPSPTR) ; 

CHB=GET$CHACO); 

IF CHA = NIL OR CHB = NIL THEN DO: RETURN; FI 

CALL PUTSCHA(VALUESPTR,SHL(CHSTOSHEX(CHA) , 4) OR CHSTOSHEX(CHB)) 
ENDDO 

ENDPROCEDURE PFSPK; 

PFSUK: PROCEDURE; 

/* 'UNPACK' ASCI I-TO-HEX S(UK,CH-STRING) «/ 

DECLARE CH BYTE; 

IF LOWCARGSPTR:=NEXTSNS) THEN DO; RETURN; FI 
FIRSTSGETASFLAG,FIRSTSPUTASFLAG=TRUE; 

VALUESPTR=FSSGET; 

DO WHILE (CH:=GETSCHA(ARGSPTR)) <> NIL: 

CALL PUTSCHA(VALUESPTR,HEXSTOSCH(ROL(CH,4) AND OFH)); 

CALL PUTSCHA(0,HEXSTOSCH(CH AND OFH)); 

ENDDO 

ENDPROCEDURE PFSUK; 

PFSSO: PROCEDURE; 

/* 'SEND TO OCTOPUS' SCSO,MESSAGE) «/ 

CALL SENDSSTRING(NEXTSNS AND PTRSMASK); 

ENDPROCEDURE PFSSO; 



Page 38 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia. Box E, Menlo Park, CA 94025 


01439 1 

01440 1 

01441 2 

01442 2 

01443 2 

01444 2 

01445 2 

01446 2 

01447 2 

01448 2 

01449 2 

01450 2 

01451 2 

01452 2 

01453 2 

01454 3 

01455 2 

01456 2 

01457 2 

01458 2 

01459 3 

01460 3 

01461 2 

01462 3 

01463 3 

01464 2 

01465 1 

01466 1 

01467 2 

01468 2 

01469 2 

01470 3 

01471 2 

01472 1 

01473 1 

01474 2 

01475 2 

01476 2 

01477 2 

01478 2 

01479 2 

01480 2 

01481 3 

01482 2 

01483 2 

01484 1 

01485 1 

01486 2 

01487 2 

01488 2 

01489 2 

01490 2 

01491 2 

01492 2 

01493 1 

01494 1 

01495 2 

01496 2 

01497 2 

01498 2 

01499 2 

01500 2 

01501 2 

01502 3 

01503 2 

01504 2 

01505 1 

01506 1 

01507 2 

01508 2 

01509 2 

01510 2 

01511 2 

01512 2 

01513 2 

01514 1 

01515 1 

01516 2 

01517 2 

01518 2 

01519 2 

01520 1 


Number 23 


PFSRO: PROCEDURE: 

/* 'RECEIVE FROM OCTOPUS' $CRO,END-SENT INEL,S.F,EOM) */ 

/* VALUESPTR IS SET IN RECEIVESSTRING AND TRANSFERRED TO $R0 */ 
DECLARE ENDSPTR ADDRESS; 

IF NOT STSF1NDC.ATSRO) THEN DO; CALL STSCREATE(.ATSRO); FI 
ENDSPTR=NEXTSNS; 

S$PTR=NEXT$NS; 

FSPTR=NEXT$NS; 

/* SET NEW OCTOPUS MESSAGE TERMINATOR, IF GIVEN */ 

CALL PFSPK: 

FIRSTSGETASFLAG=TRUE; 

IF (I TEMP:=GET$CHA(VALUESPTR)) <> NIL THEN DO; 

OCTO$EOM=I TEMP; 

FI 

CALL FREESCHAIN(VALUESPTR); 

IF RECEIVESSTRING(ENDSPTR) THEN DO; 

CALL STSADDSVALUECVALUESPTR); 

VALUESPTR=S$PTR; 

END; ELSE DO; 

CALL STSADDSVALUE(VALUESPTR); 

VALUESPTR=FSPTR; 

FI 

ENDPROCEDURE PFSRO; 

PFSDD: PROCEDURE: 

/* 'DELETE DEFINITION' S(DD,NAME,NAME,...) */ 

DO NEXTSARG; 

IF STSFIND(ARGSPTR) THEN DO; CALL STSDELETE; FI 
ENDDO 

ENDPROCEDURE PFSDD; 

PFSAD: PROCEDURE; 

/* 'ADD' SCAD,N,N, N, . . . ) */ 

/* ZERO OR MORE NUMERICAL ARGUMENTS */ 

DECLARE SUM ADDRESS; 

SUM=0; 

DO NEXTSARG: 

SUM = SUM+STRINGSTOSBI NARY(ARGSPTR); 

ENDDO 

CALL BINARYSTOSSTRING(SUM); 

ENDPROCEDURE PFSAD; 

PFSSU: PROCEDURE; 

/* 'SUBTRACT' S(SU,N,M) */ 

/* MUST HAVE EXACTELY TWO NUMERICAL ARGUMENTS */ 

CALL BINARYSTOSSTRINGC 

STRINGSTOSBI NARY(NEXTSNS)- 
STRINGSTOSBI NARY C NEXTSNS)); 

ENDPROCEDURE PFSSU; 

PFSML: PROCEDURE; 

/* 'MULTIPLY' SCML.N.N.N,...) */ 

/* ZERO OR MORE NUMERICAL ARGUMENTS */ 

DECLARE PRODUCT ADDRESS; 

PRODUCTSi■ 

DO NEXTSARG: 

PRODUCT“PRODUCT*STRINGSTOSBI NARY(ARGSPTR); 

ENDDO 

CALL BINARYSTOSSTRINGC PRODUCT); 

ENDPROCEDURE PFSML; 

PFSMD: PROCEDURE: 

/* 'MOD' $CMD,N,M) */ 

/* MUST HAVE EXACTELY TWO NUMERICAL ARGUMENTS */ 

CALL BINARYSTOSSTRINGC 

STRINGSTOSBI NARY(NEXTSNS) MOD 
STRINGSTOSBI NARY(NEXTSNS)); 

ENDPROCEDURE PFSMD; 

PFSZZ: PROCEDURE; 

/* 'SLEEP' SCZZ.TENTH SEC) */ 

DECLARE N ADDRESS; 

CALL WAITSTENTHCSTRINGSTOSBI NARY(NEXTSNS)); 

ENDPROCEDURE PFSZZ; 





Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 



Page 39 


141 


01521 1 PFSIO: PROCEDURE; 

01522 2 /* 'INPUT-OUTPUT' PARAMETERS S(10,'0'OCTO,'T'TIMEOUT,'M'META) */ 

01523 2 DECLARE CH BYTE; 

01524 2 

01525 2 DO NEXTSARG: 

01526 2 FIRST$GETA$FLAG=TRUE; 

01527 3 IF (CH:=GET$CHA(ARGSPTR)) = LIT$0 THEN DO; /* 0: SET OCTO CHANNEL */ 

01528 3 OCTOSCHANNELSA=(GETSCHA(0) = LITSA); 

01529 4 END; ELSE IF CH = LITST THEN DO; /* T: SET OCTO TIMEOUT */ 

01530 3 OCTOSTIMEOUT = STRINGSTOSBI NARY(ARGSPTR); 

01531 4 END; ELSE IF CH = LITSM THEN DO; /* M: SET META-CHARACTER */ 

01532 3 META$CHAR=GET$CHAC0); 

01533 4 END; ELSE IF CH = LITSP THEN DO; /* P: SET PRINT VIA CP/M */ 

01534 3 CPMSPRINT$FLAG=TRUE; 

01535 4 END; ELSE IF CH = LITSO THEN DO; /* D: SET PRINT DIRECT (HARDWARE) */ 

01536 3 CPMSPRINT$FLAG=FALSE; 

01537 4 FI 

01538 3 ENDDO 

01539 2 ENDPROCEDURE PFSIO; 

01540 1 

01541 1 PFSDV: PROCEDURE; 

01542 2 /* 'DIVIDE' S(DV,N,M) */ 

01543 2 /* MUST HAVE EXACTLY TWO NUMERICAL ARGUMENTS */ 

01544 2 

01545 2 CALL BINARYSTOSSTRING( 

01546 2 STRINGSTOSBI NARY(NEXTSNS)/ 

01547 2 STRINGSTOSBI NARY(NEXTSNS)); 

01548 2 ENDPROCEDURE PFSDV; 

01549 1 

01550 1 PFSNB: PROCEDURE; 

01551 2 /* 'NUMBER OF (FREE STORAGE) BLOCKS' $(NB) */ 

01552 2 DECLARE 

01553 2 (BLOCK BASED TEMPSPTR,N) ADDRESS; 

01554 2 

01555 2 TEMP$PTR=FS$FIRSTSPTR; 

01556 2 N=0; 

01557 2 DO WHILE HIGH(TEMPSPTR) > 0; 

01558 2 N=N+1; 

01559 3 TEMP$PTR=BLOCK; 

01560 3 ENDDO 

01561 2 CALL BINARYSTOSSTRING(N); 

01562 2 ENDPROCEDURE PFSNB; 

01563 1 

01564 1 PFSFS: PROCEDURE; 

01565 2 /* 'FREE STORAGE' S(FS,FIRST ADDRESS,LAST ADDRESS) */ 

01566 2 CALL FSSINIT(STRINGSTOSBI NARY(NEXTSNS),STRINGSTOSBI NARY(NEXTSNS)); 

01567 2 ENDPROCEDURE PFSFS; 

01568 1 

01569 1 PFSVN: PROCEDURE; 

01570 2 /* 'VERSION NUMBER' $(VN) */ 

01571 2 VALUESPTR = FSSGET j 

01572 2 FIRSTSPUTASFLAG=TRUE; 

01573 2 CALL PUTSCHA(VALUESPTR,'3'); 

01574 2 CALL PUTSCHA(0,'1'); 

01575 2 CALL PUTSCHA(0,LITSA); 

01576 2 ENDPROCEDURE PFSVN; 

01577 1 

01578 1 

01579 1 



Pa 9 e 40 Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 Number 23 

142 



k 


w 


01580 1 

01581 1 

01582 1 

01583 1 

01584 1 

01585 2 

01586 2 

01587 2 

01588 2 

01589 2 

01590 2 

01591 2 

01592 2 

01593 3 

01594 4 

01595 4 

01596 3 

01597 4 

01598 3 

01599 4 

01600 4 

01601 4 

01602 3 

01603 2 

01604 2 

01605 1 

01606 1 
01607 2 

01608 2 
01609 2 

01610 2 
01611 2 
01612 2 
01613 1 

01614 1 

01615 2 

01616 2 
01617 2 

01618 1 
01619 1 

01620 2 
01621 2 
01622 2 
01623 2 

01624 2 

01625 2 

01626 3 

01627 2 

01628 1 
01629 1 

01630 2 

01631 2 

01632 2 

01633 2 

01634 2 

01635 2 

01636 3 

01637 2 

01638 1 

01639 1 

01640 2 

01641 2 

01642 2 

01643 2 

01644 3 

01645 2 

01646 1 

01647 1 

01648 2 

01649 2 

01650 2 

01651 1 

01652 1 

01653 2 

01654 2 

01655 2 

01656 2 

01657 3 

01658 3 

01659 3 

01660 3 

01661 4 

01662 4 

01663 4 

01664 3 

01665 2 

01666 2 
01667 2 

01668 2 
01669 2 

01670 2 

01671 3 

01672 2 


/*** DISK I/O FUNCTIONS ***/ 

/* SEE 'BASIC I/O' ON PAGE 2 FOR GLOBALS */ 

SETSFILESNAME: PROCEDURE!FILESNAMESPTR); 

/* EXPAND D : X . Y FORMAT TO ELEVEN CHAR FILE NAME AND SELECT DRIVE */ 
DECLARE FILESNAMESPTR ADDRESS, (I,CH,DRIVE) BYTE; 

TFCB(0)= 0; 

FOR 1=1 TO 11: TFCB CI ) =' '; ENDFOR 
I,DRIVE=0; FIRST$GETA$FLAG=TRUE; 

DO WHILE tI<11) AND ((CH:=GET$CHA(FILESNAMESPTR)) <> NIL); 

IF CH = ':' THEN DO; 

TFCB(0)=DRIVE; 

1=0; 

END; ELSE IF CH = THEN DO; 

I =8; 

END; ELSE DO; 

i = I+1 ; 

TFCB(I)=UPPERSCASE!CH); 

DRIVE=CH; 

FI 

ENDDO 

CALL SELECTSDRIVE; 

ENDPROCEDURE SETSFILESNAME; 

SETSFILE$RECORD: PROCEDURECRECORDSNO); 

/* SET EXTENT AND NR FIELDS IN TFCB */ 

DECLARE RECORDSNO ADDRESS; 

TFCB!12)=SHR(RECORDSNO,7); 

TFCB(32)=RECORDSNO AND 7FH; /* SEE 'RANDOM ACCESS' IN CP/M MANUAL */ 
ENDPROCEDURE SETSFILESRECORD; 

PFSRN: PROCEDURE; 

/* 'RECORD NUMBER' $(RN) */ 

CALL BINARYSTOSSTRING(SHL!TFCB!12),7) OR TFCB<32)); 

ENDPROCEDURE PFSRN; 

PFSOF: PROCEDURE; 

/* 'OPEN FILE' S(OF,FILE-NAME,NEXT-RECORD-NUMBER,S,F) */ 

CALL SETSFILESNAME(NEXTSNS); 

CALL SETSFILESRECORD(STRINGSTOSBI NARY(NEXTSNS)); 

VALUESPTR=NEXTSNS; 

IF M0N2(15,.TFCB) = 255 THEN DO; /* OPEN AND TEST FOR ERROR */ 
VALUESPTR=NEXTSNS; 

FI 

ENDPROCEDURE PFSOF; 

PFSMF: PROCEDURE; 

/* 'MAKE FILE' $(MF,FILE-NAME,S,F) */ 

CALL SETSFILESNAME(NEXTSNS); 

CALL SETSFILESRECORD!0); 

VALUESPTR 3 NEXTSNS; 

IF M0N2(22,,TFCB) = 255 THEN DO; 

VALUESPTR=NEXTSNS; 

FI 

ENDPROCEDURE PFSMF; 

PFSCF: PROCEDURE; 

/« 'CLOSE FILE' S(CF,S,F) */ 

VALUESPTR=NEXT*NS; 

IF M0N2!16,,TFCB) = 255 THEN DO; 

VALUESPTR=NEXTSNS; 

FI 

ENDPROCEDURE PFSCF; 

PFSDF: PROCEDURE; 

/* 'DESTROY FILE' S(DF) */ 

CALL M0N1(19,.TFCB); 

ENDPROCEDURE; 

PFSWF: PROCEDURE; 

/* 'WRITE FILE' S(WF,SOURCE-NAME,PAD-CH EMPTY FLAG,S,F) */ 

DECLARE (CH,I,WRITESSTATUS) BYTE; 

STUFFSCH: PROCEDURE; 

IF WRITESSTATUS <> 0 THEN DO; RETURN; FI 
TBUFF(TBUFFSINDEX)= CH; 

IF (TBUFFSINDEX:=TBUFFSINDEX+1) = 128 THEN DO; 

WRITESSTATUS=M0N2C21,.TFCB); 

TBUFFSINDEX=0; 

STSENTRY(STSCHSPTRSINDEX)=GETSCHASCHSPTR; /* SET FORM PTR */ 

FI 

ENDPROCEDURE STUFFSCH; 

WRITESSTATUS.TBUFFSINDEX=0: 

IF NOT STSFIND(NEXTSNS) THEN DO; RETURN; FI 
GET$CHA$CHSPTR = STSENTRY CSTSVALUESINDEX)+1; 

DO WHILE (CH:=GETSCHA(0)) <> NIL; 

CALL STUFFSCH; 

ENDDO 



Number 23 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 41 

143 


01673 2 

01674 2 

01675 2 

01676 3 

01677 2 

01678 2 

01679 2 

01680 1 
01681 1 
01682 2 
01683 2 

01684 2 

01685 2 

01686 2 
01687 3 

01688 3 

01669 2 

01690 2 

01691 2 

01692 2 

01693 2 

01694 3 

01695 3 

01696 4 

01697 4 

01698 3 

01699 3 

01700 3 

01701 3 

01702 3 

01703 4 

01704 3 

01705 2 

01706 1 

01707 1 

01708 2 

01709 2 

01710 2 

01711 2 

01712 2 

01713 2 

01714 2 

01715 1 

01716 1 


FIRSTSGETBSFLAG=TRUE; 

IF (CH:=GET$CHB(NEXTSNS AND PTR$MASK)) <> NIL THEN DO: 

F[ FOR 1=0 TO 127; CALL STUFFSCH; ENDFOR /* GUARANTEE A WRITE WITH PAD CH */ 
VALUESPTR=NEXTSNS; 

IF WRITESSTATUS <> 0 THEN DO; VALUESPTR=NEXTSNS; FI 
ENDPROCEDURE PFSWF; 

PFSRF: PROCEDURE; 

/* 'READ FILE' S (RF,SINK-NAME,RECORD-COUNTjS,F) (F=EOF) */ 

DECLARE RC ADDRESS; 

IF NOT STSFIND(ARGSPTR:=NEXT$NS) THEN DO; 

CALL STSCREATEtARGSPTR): 

CALL STSADDSVALUE(FSSGET); 

FI 

RC = STRINGSTOSBI NARY(NEXTSNS); 

VALUESPTR=NEXTSNS; 

DO WHILE RC > 0; 

RC = RC"1 * 

IF M0N2C20,,TFCB) <> 0 THEN DO; 

VALUESPTR=NEXTSNS; 

RETURN; 

FI 

PUTSCHA$CH$PTR = APPEND$CH(TBUFF,STSENTRY(STSVALUES INDEX)) ; 

PUTSCHASCURRENTSBLOCKSPTR=PUTSCHASCHSPTR AND PTRSMASK; 

FIRSTSPUT ASFLAG = FALSE; 

FOR TBUFFSINDEX=1 TO 127; 

CALL PUTSCHA(0,TBUFF(TBUFFSINDEX)); 

ENDFOR 

ENDDO 

ENDPROCEDURE PFSRF; 

PFSRD: PROCEDURE; 

/* 'READ DIALECT' $(RD) */ 

/* EACH RD WILL GO TO THE NEXT META CHARACTER - */ 

/* OK IF NO INTERVENING MF OR OF. */ 

CONS IN = FALSE; 

TBUFFSINDEX=128; 

CALL PFSRS; 

ENDPROCEDURE PFSRD; 



Page 42 

144 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 23 


/*** PROCESS FUNCTION CALL ***/ 


01717 1 

01718 1 

01719 1 

01720 2 

01721 2 

01722 2 

01723 2 

01724 2 

01725 2 

01726 2 

01727 2 

01728 3 

01729 3 

01730 3 

01731 3 

01732 3 

01733 3 

01734 3 

01735 3 

01736 3 

01737 3 

01738 3 

01739 3 

01740 3 

01741 3 

01742 3 

01743 3 

01744 3 

01745 3 

01746 3 

01747 3 

01748 3 

01749 3 

01750 3 

01751 3 

01752 3 

01753 3 

01754 3 

01755 3 

01756 3 

01757 3 

01758 3 

01759 3 

01760 3 

01761 3 

01762 3 

01763 3 

01764 3 

01765 3 

01766 3 

01767 3 

01768 3 

01769 3 

01770 3 

01771 3 

01772 3 

01773 3 

01774 3 

01775 3 

01776 3 

01777 4 

01778 3 

01779 3 

01780 2 

01781 2 

01782 2 

01783 2 

01784 3 

01785 2 

01786 2 


PROCESSSENDSFUNCTI0N: PROCEDURE; 

DECLARE 

NAMESPTR ADDRESS, 

NAME BASED NAMESPTR ADDRESS, /* HOLDS THE FIRST TWO CHARS OF NAME */ 
NAMESCH BASED NAMESPTR BYTE, 

(BLOCKSPTR,BLOCK BASED BLOCKSPTR) ADDRESS, 

(CH,FIRSTSCH,SECONDSCH) BYTE; 


PFSINDEX: FUNCTION(CHCH) BYTE: 

/* INDEX OF THE PRIMITIVE FUNCTION WHOSE TWO CHAR NAME IS CHCH */ 
/* NOTE... NAME LIST HAS SECOND CHARACTER FIRST, LIKE ADDRESS */ 
DECLARE 
CHCH ADDRESS, 

I BYTE, 

PFSLI ST(40) ADDRESS INITIAL! /* ORDERED BY FREQUENCY */ 

736EH, /* NS */ 

7165H, /* EQ */ 

6E69H, /* IN */ 

746EH, /* NT */ 

6567H, /* GE */ 


7263H, /* CR */ 
6367H, /* GC */ 
7373H, /* SS */ 
6B70H, /* PK */ 
6461H, /* AD */ 
7361H, /* AS */ 
6464H, /* DD */ 
7573H, /* SU */ 
6C6DH, /* ML */ 
7664H, /* DV */ 
6672H, /* RF */ 
6677H, /* WF */ 
666FH, /* OF */ 
6663H, /* CF */ 
6E72H, /* RN */ 
666DH, /* MF */ 
6664H, /* DF */ 
6472H, /* RD */ 
646DH, /* MD */ 
6B75H, /* UK */ 
7370H, /* PS */ 
6F73H, /* SO */ 
6F72H, /* RO */ 
6F69H, /* 10 */ 
7865H, /* EX */ 
626EH, /* NB */ 
6E74H, /* TN */ 
6674H, /* TF */ 
7766H, /* FW */ 
6E76H, /* VN */ 
6C63H, /* CL */ 
7372H, /* RS */ 
7A7AH, /* ZZ */ 
7366H. /* FS */ 
7473H); /* ST */ 



FOR 1=0 TO LAST(PFSLIST); 

IF CHCH = PFSLISTCI) THEN DO; RETURN I; FI 
ENDFOR; 

RETURN LENGTH(PFSLI ST); /* NO MATCH */ 
ENDFUNCTION PFSINDEX; 


NSSSTACK(NSSSTACKSINDEX*1)“NULLSSTRINGSPTR OR NSSNULLSBEGINSEND; 

DO WHILE NOT NSSFUNSMARKER; /* FIND THE BEGINNING OF THE CURRENT FUNCTION*/ 
NSSSTACKSINDEX=NSSSTACKSINDEX-1; 

ENDDO; 




Number 23 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 43 

145 



01787 2 

01788 2 

01789 3 

01790 2 

01791 3 

01792 3 

01793 3 

01794 3 

01795 3 

01796 3 

01797 3 

01798 3 

01799 3 

01800 3 

01801 3 

01802 3 

01803 4 

01804 3 

01805 4 

01806 5 

01807 5 

01808 5 

01809 5 

01810 5 

01811 5 

01812 5 

01813 5 

01814 5 

01815 5 

01816 5 

01817 5 

01818 5 

01819 5 

01820 5 

01821 5 

01822 5 

01823 5 

01824 5 

01825 5 

01826 5 

01827 5 

01828 5 

01829 5 

01830 5 

01831 5 

01832 5 

01833 5 

01834 5 

01835 5 

01836 5 

01837 5 

01838 5 

01839 5 

01840 5 

01841 5 

01842 5 

01843 5 

01844 5 

01845 5 

01846 5 

01847 4 

01848 3 

01849 3 

01850 3 

01851 3 

01852 3 

01853 3 

01854 3 

01855 3 

01856 4 

01857 5 

01858 4 

01859 4 

01860 4 

01861 3 

01862 3 

01863 3 

01864 3 

01865 4 

01866 3 

01867 4 

01868 3 


IF NSSLIMlTSMARKER THEN DO; /* NO 'BEGIN' FOR THIS 'END' */ 

GO TO START ; 

“ H ° SE NA " E 15 * T "S.ST.CK..NDEX •/ 

IF TRACESFLAG THEN DO: CALL TRACESPRINT; FI 

/* NAME IS TAKEN FROM THE FIRST TWO BYTES */ 

/* OF THE FIRST ARGUMENT, REGARDLESS OF THE CONTENTS */ 
NAMESPTR=NSSSTACK(NSSSTAfcKSINDEX) AND PTRSMASK; 

VALUE$PTR=NULLSSTRINGSPTR: 

/* TEST FOR TWO CHAR FUNCTION NAME AND FIRST CHAR A-Z */ 

FIRST$CH=NAMESCH(2): SECONDSCH = NAMESCH(3); 

IF SECONDSCH = NIL OR NAMESCH(4) <> NIL OR 

FIRSTSCH < LITSA OR FIRSTSCH > LITSZ THEN DO; /* NOT A PF */ 
CALL PFSCL(- 1); 

END: ELSE DO: 

SELECT PFSINDEX!NAME(1)) OF 
CALL PFSNS; 

CALL PFSEQ; 

CALL PFSIN; 

CALL PFSNT; 

CALL PFSGE; 

CALL PFSCR; 

CALL PFSGC; V s 

CALL PFSSS; - 

CALL PFSPK; 

CALL PFSAD; > N. 

CALL PFSAS; -> _ _ ) 

CALL PFSDD; 

CALL PFSSU; \ --- -7 /- 

CALL PFSML; ^ 

CALL PFSDV; 

CALL PFSRF; 

CALL PFSWF; 

CALL PFSOF; 

CALL PFSCF; 

CALL PFSRN; 

CALL PFSMF; --5\ 

CALL PFSDF; v \ 

CALL PFSRD; 

CALL PFSMD; ) 

CALL PFSUK; _ m y 

CALL PFSPS; /V ^-- 

CALL PFSSO; \^y - ^ 

CALL PFSRO; ^ 

CALL PFS10; 

CALL PFSEX; 

CALL PFSNB; 

CALL TURNSTRACESON: 

CALL TURNSTRACESOFF; 

CALL PFSFW; 

CALL PFSVN; 

CALL PFSCL(0) ; 

CALL PFSRS; 

CALL PFSZZ; 

CALL PFSFS; 

BEGIN PRELOADED=TRUE; EXIT; END; /* ST */ 

CALL PFSCL!-1); /* NO MATCH, ASSUME 'CL' */ 

ENDSELECT 

FI 

VALUESPTR=VALUESPTR AND PTRSMASK; 

/* RELEASE ARGUMENTS FOR THE FUNCTION WHICH WAS JUST DONE */ 

/* AND LEAVE NULL PTR + NS-END FLAGS IN PLACE OF THESE ARGS */ 

/* BUT DON'T RELEASE AN ARG IF IT IS THE VALUE */ 

NSSSTACKSINDEX = NSSSAVES INDEX; 

DO WHILE NOT NSSLIMITSMARKER; 

IF VALUESPTR <> (ARGSPTR:=NSSSTACK(NSSSTACKSINDEX)) THEN DO; 

CALL FREESCHAIN(ARGSPTR); 

FI 

NSSSTACK(NSSSTACKSINDEX)=NULL$STRINGSPTR OR NSSNULLSBEGINSEND; 
NSSSTACKSINDEX=NSSSTACKSINDEX+1; 

ENDDO 


/* SEE IF THIS ASSBLOCK CAN BE RELEASED */ 

IF (LOW(ASSCHSPTR) AND NOTSPTRSMASK) = 0 THEN DO; 

CALL ASSFREESBLOCK; 

END; ELSE IF (ASSCH = NIL) AND (HIGH(ASSBLOCK) > 0) THEN DO; 

CALL ASSFREESBLOCK; 

FI 



Page 44 

146 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 23 




01869 3 

01870 3 

01871 3 

01872 3 

01873 3 

01874 4 

01875 3 

01876 4 

01877 5 

01878 5 

01879 6 

01880 5 

01881 5 

01882 5 

01883 5 

01884 4 

01885 5 

01886 5 

01887 6 

01888 5 

01889 5 

01890 4 

01891 3 

01892 2 

01893 1 

01894 1 

01895 1 

01896 1 

01897 1 

01898 1 

01899 1 

01900 2 

01901 2 

01902 2 

01903 2 

01904 2 

01905 2 

01906 3 

01907 2 

01908 1 

01909 1 

01910 2 

01911 2 

01912 1 

01913 1 

01914 1 

01915 2 

01916 2 

01917 2 

01918 2 

01919 2 

01920 2 

01921 3 

01922 2 

01923 2 

01924 2 

01925 2 

01926 2 

01927 2 

01928 3 

01929 2 

01930 2 

01931 2 

01932 3 

01933 3 

01934 4 

01935 4 

01936 4 

01937 3 

01938 2 

01939 1 

01940 2 


/* PROCESS THE VALUE CHAIN */ 

NSSSTACKSINDEX = NSSSAVESINDEX-1; 

NS$ARG$BREAK=TRUE; 

IF VALUE$CH( 2) = NIL THEN DO: 

CALL FREESCHAIN(VALUESPTR); 

END: ELSE DO: 

IF NSSACTIVESFLAG>0 THEN DO; /*LINK VALUE CHAIN TO HEAD OF ACTIVE*/ 
BLOCKSPTR=VALUESPTR: 

DO WHILE HIGH(BLOCK) > 0; /* FIND END OF VALUE CHAIN */ 

BLOCK$PTR=BLOCK; 

ENDDO 

BLOCK=AS$BLOCK$PTR; 

AS$BLOCKSPTR=VALUESPTR; 

ASSCHSPTR=AS$BL0CK$PTR+2; 

END: ELSE DO: /* ADD VALUE TO END OF CURRENT (NEUTRAL) ARGUMENT */ 
FIRST$GETA$FLAG=TRUE: 

DO WHILE (CH:=GET$CHA(VALUESPTR)) <> NIL; 

CALL NSSADDSCH(CH); 

ENDDO 

CALL FREESCHAIN(VALUESPTR); 

FI 

FI 

FI 

ENDPROCEDURE PROCESSSENDSFUNCTI ON; 


/*** INITIALIZATION AND SCAN LOOP ***/ 

DECLARE CH BYTE; 

PRESETSATIN: PROCEDURE: 

IF NOT STSFIND(.ATS IN) THEN DO; CALL STSCREATE(.ATS IN); FI 
CALL STSADDSVALUE(VALUESPTR:=FSSGET); 

FIRST$PUTASFLAG=TRUE; 

ITEMP=2; 

DO WHILE I TEMP <= TBUFF(O); 

CALL PUTSCHA(VALUESPTR,TBUFF((I TEMP:=ITEMP+1)-1))J 
ENDDO 

ENDPROCEDURE PRESETSATIN; 

PRrQrTtnpiuPQ 1 PRflf'Fni irf ■ 

DEFAULTSDRiVE.PREVIOU&SDRIVE,CURRENTSDRIVE=M0N2(25,0); 

ENDPROCEDURE PRESETSDRIVES; 

IF DEADSSTART THEN DO; 

DEADSSTART=FALSE; 

TRACESFLAG=0; 

ASSBL0CKSPTR=0; 

FSSFIRSTSPTR=0; 

TEMPSPTR=FBASE; 

IF TFCB(17) = 5EH THEN DO; /* 'ACT FILE HH' HH=HEX PAGE NO. BEYOND FS */ 
TEMP$PTR=256*(DOUBLE(SHL(CHSTO$HEX(TFCB(18)),4) OR CHSTOSHEX(TFCB(19)))); 
FI 

CALL FSSINIT(.MEMORY,TEMPSPTR); 

CALL STS I NIT; 

CALL STSREINIT; 

NULLSSTRINGSPTR=FS$GET; 

FOR NSSSTACKSINDEX=1 TO LAST(NSSSTACK); 

NSSSTACK(NSSSTACKS INDEX)=NULLSSTRINGSPTR OR NSSNULLSBEGINSEND; 

ENDFOR 

CALL PRESETSDRIVES; 

IF TFCB(1) <> ' ' THEN DO; /* DISK INPUT */ 

CALL PRESETSATIN: 

IF M0N2(15,.TFCB) <> 255 THEN DO; 

CALL SELECTSDRIVE; 

CONS IN = FALSE; 

TFCB(32)=0; 

FI 

FI 

END; ELSE IF PRELOADED THEN DO; 

PRELOADED = FALSE; 

CALL PRESETSDRIVES; 


01941 2 CALL PRESETSATIN; 

01942 2 CONS IN=TRUE; 

01943 2 FI 

01944 1 

01945 1 CALL ASSNSSINIT; 

01946 1 

01947 1 DO FOREVER; 

01948 1 IF (CH:=ASSNEXTSCH(MOVESPTR)) = LEFTSDELIM THEN DO; 

01949 2 CALL PROCESSSQUOTEDSSTRING; 

01950 3 END; ELSE IF CH = ARGSDELIM THEN DO: 

01951 2 CALL STARTSNEXTSARGUMENT(NSSARGSFLAG); 

01952 3 END; ELSE IF CH = FUNSCH THEN DO; 

01953 2 CALL PROCESSSBEGINSFUNCTI ON; 

01954 3 END: ELSE IF CH = RIGHTSDELIM THEN DO; 

01955 2 CALL PROCESSSENDSFUNCTI ON; 

01956 3 END: ELSE DO: 

01957 2 CALL NSSADDSCH(CH); 

01958 3 FI 

01959 2 ENDDO 

01960 1 EOF 

NO PROGRAM ERRORS 



Number 23 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 45 

147 



SAM 76 — Additional comments 


Dear Jim: 

I just got around to reading your issue 10, volume 2, and 
was pleased to see the article by Frits Van Der Wateren 
which describes an implementation of Strachey's GPM for the 
6 800. 


The first purpose of this letter is to | | || 

point out to the relatively uninitiated | j GP1 - SAM76 | | 

that the SAM76 language, described in ||_[| 

your first issue of volume 3 has its 

roots in GP1, and that the structure and philosophy are 

virtually identical between the two languages. 


II II The main difference between the two 

II Mimicking || languages is the scope of available 

|J_II resident functions, as well ascertain 

features of SAM76 whuch enable precise 
user definition in the SAM76 language of functions which 
might a Isa be defined in terms of assembly language 
instructions - in other words "exact mimicking capability". 

This feature is important to permit portability or 
transferability of user programs or, as I prefer to call 
them, scripts. Should some user script make use of a 
function not resident in some one else’s SAM76 interpreter, 
it is relatively simple to create a user defined function 
identical in its functioning to the resident function 

originally used- 


II 11 A version of the SAM76 language coded for 

| |SAM76 - 6800 | j the 6800 is in process of development by 

11_LI the "notorious" Wayne Loufbrow youngster; 

it is expected that this version will be 
functionally identical to the 80 80/Z80 implementation, thus 
permitting absolute transferability of user scripts. 


The second purpose of this letter is to 
respond to some queries from users as to 
the problem of formatting user script for 
appearance and legibility, and yet not 
cause these formatting characters to 
become part of the evaluation process. 


| Addendum to | 

| SAM 76 | 

| description |! 

J_1 


Because of the celerity with which you published the 
description of the SAM76 language, I was not able to make 
the appropriate addition which responds to thus problem; 
thus addition is described below, as it will appear in the 
forthcoming "SAM76 language Handbook" • 

The table under the heading "Quoting or Protection" on page 
20 should t>e ammended by the addition of the "IC" warning 
character as illustrated by the excerpt shown below. 


AS 

1 

77 

Argument separator 

QC 

0 

100 

Quote 

single character 

IC 


140 

Ignore 

single character 

The 

following 

specification 

for thu. s warning 


should be concatenated, with scissors and glue, at the end 
of the SAM76 language description just ahead of the birds on 
page 22 of your magazine. 



SIERRA DIGITAL’S PDP8 X8 
CROSS ASSEMBLER SERIES 

News Release Received: 77 Dec 30 

Sierra Digital Systems has announced the addition of four new 
microprocessor cross-assemblers to its X8 cross-assembler series for the 
Digital Equipment Corporation PDP8 mincomputer. The X8 series 
cross-assemblers now cover the Z80, 1802, SC/MP and 8048 micro¬ 
processors in addition to the previous 6502, 6800, 8080, F8 and 2650 
version. 

By using an X8 series cross-assembler, assembly language programs 
are converted into object code which may t>e loaded into a microproces¬ 
sor system, or put into ROM of PROM memory. X8 cross-assemblers 
feature a Universal Assembler Format of common assembler directives 
and techniques. This standardization of features combined with a 
quantity discount schedule makes the series especially attractive to 
users of more than one microprocessor type. New special package offers 
at very substantial discounts are available to Educational Institutions 
for microprocessor course development. 

Sierra Digital's X8 cross-assemblers run in 8K words of memory 
under the OS/8 operating system. The X8 assemblers are written in 
PDP8 assembly language to provide very fast operation and minimum 
memory requirements. Pseudo-ops and runtime options provide for 
conditional assembly and extensive listing control. Generated object 
code may be output in the microprocessor's standard loader format, or 
BNPF for ROM generation. 

Each cross-assembler is priced at $400 and distributed in PDP8 
binary format on paper tape, Dectape, or Dec floppy diskette. Source 
files are also available for an additional $250. Sierra Digital Systems 
is located at 13905 Rancheros Drive, Reno, Nevada 89511, 
(702) 329 -9548. 


II II 

Ignoring 11 

I | next character | j 

II _LI 

circumstances these 
expressions, and be 
deleted in the scanner. 


Oftentimes the user wishes to arrange 
his script for convenient legibility 
using "nulin", "tabs" or other 
characters; this is strictly for 
formatting purposes. Under normal 
characters will be part of the 
returned in the value string unless 


Oie way of achieving this is to place these characters in 
unused arguments of primitives such as the third argument of 
an "os" expression. This could be a problem if at some later 
time the additional unused arguments acquire a purpose. 

Under initialized conditions the . character is used to 

signify that the immediately next ensuing character is to hie 
deleted in the scanner. 


Another bright youngster, Karl Nicholas, 
pointed out to me that expression "k" 
under < sham > on page 23 was 

unnecessarily complicated, and suggested 
the following simplification which after 
being checked out showed the correctness of hiis observation: 

< k > 

%pt,, (l)/%i/!lll/ 


Final 

| | erratum | | 

II_LI 


| | Closing | | 

I | comments | | 

II _LI 


Plaudits and bouquets to your staff wlio 
did a great job of laying out in an 
esthetic and artistic manner the rather 
complicated material you received from 
me- 


I hope that the growing body of users of the SAM76 language 
will contribute algorithms and scripts to your pages, and in 
that manner provide an escape from the "liasic" syndrome- 

Cordially, 

Ancelme Roichel 


148 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 23 














Dr. Dobbs louRNALof 

COMPUTER 

(Calisthenics f) Orthodontia 

Running Light Without Overbyte 

Number 24 April 1978 Volume 3, Issue 4 

A REFERENCE JOURNAL FOR USERS OF HOME COMPUTERS 

List Processing Unravelled: Pointers, Chains, Rings and Trees J. M. Terry 4 


Exit This Reviewer Jef Raskin 19 

DDJ’s Reviewer puts his mouth where his money is 

SOFTWARE 

The Oznaki “Life” Harvey A. Cohen 10 

An interactive version for the Poly 88 

AIK Debugger for the Z-80 Les Hancock 12 

A Line-Oriented PILOT Editor David J. Morgan 22 

ACT: An 8080 Macroprocessor Alex Cecil 27 


Assembly listing ofPL/M version published in previous DDJ 





© David Dameron 1979 










UNIX FOR THE 8080 


Dear Jim, Received: 78 Feb 17 

I’ve been bitten by the bug. The computer bug, that is. Two 
years ago I literally stumbled into a computer for the first 
time. And —BAAM!! Now I own one. And it’s continually 
expanding, taking big bytes out of my wallet. 

I’ve always wanted a computer that would do what the 
11/70’s would do: control everything, and be easy and fun to 
use. Until recently I couldn’t have begun to do that. But after 
a summer with an 11/70 and Bell Lab’s Unix, I might just be 
able to. 

Exactly what I want my IMSAI to do is tough to say, but 
here goes: EVERYTHING. More precisely, I want it to sup¬ 
port several terminals on a time sharing basis, and time share 
with the same benefits Unix provides. The computer should be 
able to perform processes without my supervision, and poll 
many inputs and take actions on its own when required. I plan 
to someday have it running my house, from the toaster to the 
alarm clock to the security devices. Sounds incredible, but 
when completed, it should be fantastic. 

Anyone who has worked on Unix knows sort of what I 
have to do. But for those who don’t, a short explanation. 
Everything the computer has to do will be kept on floppy disk 
and accessible by the computer. The two terminals (soon 
three) will interrupt the computer for input, and when a line is 
complete, it will be put into the process table. When the com¬ 
puter comes to this command, it will load it from the disk, and 
enter it again into the process table to be executed in due 
time. (The terminal is then free to be used again, and can have 
more than one process running under its name at any one 
time.) Each process in the table will be given equal amounts of 
the computer’s time, say 1/10 second apiece. When a process 
is complete, it will jump to a routine and have its name re¬ 
moved from the table. In between processes, the computer will 
poll predefined input ports to see if anything has come up and 
needs to be dealt with, like a burglar, or a process that has 
been ‘sleeping’ for a while and needs to be awakened. Each 
process would have its own stack and storage area for its regis¬ 
ters when another process is being executed. Also included in 
the shell (a Unix word meaning the part of the computer pro¬ 
gram that oversees all of these actions, and regulates time) 
would be such luxuries as piping, terminal to terminal conver¬ 
sation, and the old late night weapons, enable and disable 
(terminals); However, it is important to remember that the 
program will not have any assemblers, editors, or languages in 
it. Everything will be kept on disk and only loaded when 
needed. This allows for great flexibility, as the control for any 
piece of hardware can be loaded on the disk, and not take up 
valuable RAM. 

This version of Unix will give my micro (and yours too!) 
part of the power that minis and macros have, and make it 
much more useful around the house. Aside from the questions 
I’m about to ask, the only major problem will be the organiza¬ 
tion. It will be very easy to get tied up in jumps and loops and 
calls. It will have to be very efficient on both RAM and operat¬ 
ing time (its going to run slow anyway.) If I take my time 
about it and think it through completely before I begin to 
write, it shouldn’t be very difficult. 

There are some problems I can already forsee; 

1) The 8080 has eight interrupts (or restarts) at its disposal. 

I would like more. Anybody know how? 

2) In order to conserve RAM, each program on disk will 
have to be entirely relocatable. The best method I have 
thought of yet is to insert before each addressing com¬ 
mand one of the unused hex bytes. While loading, when 
the computer comes across this byte, it will adjust the 
following address by the amount the new SA is apart 


from the base SA, and leave out the flagging command 
when it loads it into RAM. If someone has a better idea, 
let me know. 

3) As the operating system stands now, every process will 
be given equal time. Is it worthwhile to set up a priority 
system so that important software can run faster than 
other software? 

4) Should I use the Z80 instead of the 8080? The Z80 
would clear up some relative addressing problems, but 
leaves no unused commands to use as a flag in the relo¬ 
cate operation. Anybody who can convince me in either 
direction wins my thanks. 

5) What should I call it? Unix for the 8080? Trivial question. 

6) And finally, is anybody interested in such a program? 
Anybody want to make a few suggestions? 

In case you’re interested in what kind of system I have, it 
consists of an IMSAI 8080, 32K RAM, IMSAI PIC board 
w/programmable interrupts, IMSAI MIO board, two Poly¬ 
morphic video displays w/keyboards, a Peripheral Vision 
Floppy Disk & interface, a high speed dot matrix printer, 
Cromemco’s analog I/O w/ two joysticks, an optical papertape 
reader, and lots of software (tank game, Star Wars game, HAM 
interface, theatrical lighting control, etc. all of my own 
writing). 

I plan to spend this next summer writing Unix for the 8080 
and associated programs. I’d like to hear from anybody on this 
program, especially anyone from the Delaware area (where I 
live), or the Northwest Connecticut area where I go to school. 

Keep up the good work at DDJ, 

Pierre duPont 
Salisbury School 
Salisbury, CT 06068 

We’re interested in such a program and we’ll be happy to 
publish suggestions and ideas pertinent to your project... 
and maybe you ’ll send us the results. Happy coding! -TRW 



STAR WHA-A-A-T? 

Gentlemen: Received: 78 March 9 

Long, long ago in a galaxy far, far away, there was bom a 
new product line of computers. The company was an estab¬ 
lished retail outlet starting amidst strong competition, but this 
line had an edge over most others: it was prebuilt and tested. 

This company has had its complement of renegades. Unfor¬ 
tunately the renegades occupied the big offices with the long 
titles on the doors. These outcasts secreted away documents 
on a space satellite. What documents you ask? All documents 
on Hardware and Software. Yes friends, it is indeed a crime. 
And what’s worse - the satellite came crashing down to Earth! 
Already the renegades are being hunted down by the DETH 
STAR. (Documentation in Entirety, Truth, 7/onesty), con¬ 
trolled by General Competishun. This Texas based, handy 
dandy radio hut had better get off its AScii before Darth 
Vector points his blinking cursor and erases you. 

Signed, 4730 Cloister Ave. NW 

Jeffrey Greek Canton, Ohio 44709 

O. B. 1 

(Overwrought and befuddled) 


Number 24 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 3 

151 



POINTERS, CHAINS, RINGS &TREES 



BY J. M. TERRY 

P. 0. Box 3945 
Lubbock, TX 79412 

There is more to learning programming than the memoriza¬ 
tion of instruction sets or statement types. A distinction is 
often made between two different sorts of skill acquisition, 
“horizontal” and “vertical”. For instance, learning BASIC 
as a first language is “vertical”. After that, it takes a “horizon¬ 
tal” effort for the programmer to leam how expressions are 
written in FORTRAN. It takes a different kind of effort 
to leam the use of the ALLOCATE and FREE statements 
in PL/1 because there are no equivalent statements in BASIC. 
When we acquire new concepts, a “vertical” effort is needed. 
Most of the following concepts are beyond BASIC. The 
steps aren’t difficult, but are definitely “vertical”. 

Sooner or later, we are going to need powerful, elegant 
ways to handle records. Those of us interested in robotics, 
languages, and various other Artifical Intelligence (AI) appli¬ 
cations will want to connect information in complicated ways. 
Systems buffs will want to manipulate individual programs 
(tasks) as objects. Business software certainly can make use 
of efficient record handling. 

Pointers 

From assembler language on up, data items are associated 
with names. For instance, when a variable is assigned a value, 
that value is put in the location with that name. Thus, 

LETS= 12 

in BASIC means that the place named “S” is to contain “12”. 
When the program is loaded, the variable’s name is equivalent 
to its address. If, in this BASIC, variables are eight bytes long, 
then the eight bytes representing “S” are “pointed to” by 
some address. Individual instructions may use different con¬ 
ventions for arriving at it, but all instructions referring to “S” 
must reference this address. Notice that two bytes is always 
the maximum needed to point anywhere inside the addressing 
range of a 64K MPU. So, “S” is the same as some two-byte 
address. If “SOCIAL_SECURITY” had been used instead of 
“S”, its equivalent address would still be two bytes. 

Consider this array: 

DIM ALPHA(5) 

This defines five strings of eight bytes each in our BASIC. We 
want to sort them using a bubble-sort. If the first of a pair 
of values is larger than file second, we save the first, move the 
second to the first’s position, and put the saved value in the 
second position, thus swapping the values. In this way, we pass 
through all four pairs repeatedly until none are swapped. 
The smaller values will “bubble” up to their proper places. 
Notice that every time we swap a pair we must move eight 
bytes three times. Now, suppose that we had the addresses 
of the eight-byte strings in another array. We might construct 
an assembler program which referenced the strings using 
this address array. We could perform the sort on the address 
array. Each ‘swap’ would involve just two bytes for each of 
the three moves, instead of eight bytes for each move (Fig. 1). 

There are many other powerful uses of pointers, but these 
will do for what follows. 


Fig. 1: Sorting Using Record Addresses 



APPRfSS KFCa/tOS 

TABLE 


A. Jones’ record should come before Smith's. 



B. Move'Addrl'to C. Move'Addr2' D. Restore current 

SAVE to previous pointer from 

pointer SAVE 



E. Pointers to the records are now in the correct order. The records 
themselves have not been moved. 

-> 

rOUJTE/t 

• ..->■ 

Move o fee avow 

Memory Management 

There are many times when it is desirable to postpone 
defining the location of data in memory. Suppose you want 
to write a general routine for updating personnel records, but 
each job description uses a different format and size, because 
each involves different details. You have hopes of using 
some of the memory for interactive programs. If you allow for 
the largest record all the time, it may mean that certain 
programs will have to stay on peripherals to be loaded when 
needed, slowing the system. You would like a better way. 

If your operating system has a memory-manager, then all 
you have to do is wait until the storage to hold a record is 
needed. When it learns the size needed, your program can 
pass this information to the memory-manager. A pointer 
will be returned indicating where the allocation of memory 
begins. There is a second, complementary function of the 
memory-manager: he must be able to free memory as well 
as allocate it, or, sooner or later, he will run out. 

Memory-managers are used whenever allocation is post¬ 
poned until the program is actually executing. In addition 
to its importance in processing of variable-length records, 
this is desirable or necessary for recursive programs, inter¬ 
active interpreters, loaders, and lists. A list, by the way, is 
a data set whose size can change during program execution. 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 24 


V 


152 




Chains 


When we interact with our systems through terminals, we 
say we are processing in real-time. This is contrasted with 
batch processing, in which a procedure is first defined com¬ 
pletely, then executed. Systems with which people interact 
have fewer uses for which memory can be defined when they 
are loaded than batch programs do. An interactive program 
may not leam what memory it needs until some point in the 
interaction with the user. 

In many systems it is better to process requests on a “first 
come, first served” basis. When a terminal interrupts an 
ongoing task, its request is not processed immediately. Instead, 
a very short routine is invoked which saves the request. The 
processor then returns to the interrupted task. When this task 
is finished, the next request is begun. These requests are being 
stored in a First-In-First-Out (FIFO) queue. The “enqueuing” 
algorithm allocates enough space for the request and its para¬ 
meters (Fig. 2a). The pointer to the new allocation is stored 
in the FORWARD field of the element pointed to by 
LATEST. This stored pointer links the allocation. Then the 
new allocation’s pointer is stored in LATEST to make finding 
the end easier. 

When the current task is finished, it is time to de-queue a 
request. CURRENT points to the information for the request 
just finished. The FORWARD field of the element that 
CURRENT points to indicates the information for the next 
request. We are through with the current element. We move its 
FORWARD field to SAVE. The contents of CURRENT are 
passed to the memory-manager in a free-memory call. SAVE 
is moved to CURRENT. This pointer is passed to the request 
handler, which begins the task specified in the data element 
pointed to (Fig. 2b). 

If we didn’t compare CURRENT and LATEST, we wouldn’t 
know if FORWARD contained a pointer or meaningless 
garbage. Besides, how do we know if the queue is empty? A 
null value for pointers simplifies everything. This could be 
anything, but “0000” (hexadecimal) or some address in ROM 
might do for an MPU system. It is easy to remember that 
zeroes are null, and since low memory often is reserved for 
interrupts, it isn’t likely that the ability to allocate from that 
address will ever be missed. Whenever an element is added to 
the end of a chain, its FORWARD pointer should be set to 
NULL. The handling routines can easily tell when a list is 
empty or when an end is reached by testing for NULL. 


Fig. 2: FIFO Queue Manager 



chained requests 


newly allocated 
and initialized 
request element 


A. Enqueue —Immediate request handling —create new request 
element and store request in it. 



B. De-queue—Move 
pointer to new 
element into 
FORWARD field of 
latest element, then 
to LATEST pointer 


The list described in Figs. 2a and 2b is called a one-way 
linked list, or a one-way chain. The links are the FORWARD 
fields. We used LAST to point to the latest entry, but that 
is not strictly necessary. As long as we know where the chain 
starts, we can advance, link by link, until a NULL indicates 
the end. 

Often we will want to insert or delete in the middle of 
a chain. For instance, we may be using a chain to hold data 
we wish to keep in alphabetical order. To search, we follow 
the chain out link by link, comparing the key field of each 
element with the name to be added (Fig. 3a). The pointer 
returned with the allocation for the new element must be 
stored in the element preceding the inserted element. We don’t 
know which element that will be until we find a key field 
with a higher sort value (that is, a key later in the alphabet) 
than the name to be inserted. Therefore, we must save a 
pointer to the last element every time we advance another 
element. If each element contains a BACKWARD pointer, 
search and insertion is simplified (Fig. 3b). This structure is 
called a two-way linked list, or two-way chain, naturally 
enough. 


Fig. 3a: Insertions 




-> 

[ F-ert 

9 




* 

% 

c 

• 

1 



rC<**K 


'a//. 


OCO-Tl c 


A. Insertions in a 
one-way chain 


Number 24 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 5 

153 













Deletions are similar to insertions, only backwards. Pointers 
are altered to point around the deleted element. A pointer to 
the deletion must be passed to the memory-manager in order 
to free it; otherwise that allocation can’t be used again (Fig. 
4a, 4b). 


g ACXWAtP '• 





■ Fe>A wA HO 
BAc wuSA/eO 



Fo#iaja4 P 

FctwAAD - 

•&ACK hjAXP 

'~-8AtKU>AAP 

Zta. to. 

£ 


I SAVt 

SAVt 

POlUTtft 

TO 

A4/4/\M<Sfye’> 


FOFWAAO 

BACFiaJAAP 

$e/e t(<f 
Sara. 


pR ft sesvict) 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 24 





































Rings 


There are times it is more convenient not to have an end in 
a chain. If the (null) last element of a chain is linked to the 
first, a circular list, or ring, results. Suppose you are designing 
an operating system to support up to sixteen terminals for 
computer-assisted instruction (CAI) applications. You need 
information on each user currently logged on the system. 
You want your monitor to poll each terminal in turn, but 
only if it is logged on. Simply let the user data reside in a 
circular list. Each LOGON procedure will insert an element 
describing terminal and user, and each LOGOFF will delete 
the proper element. When a user surrenders MPU control, 
polling will proceed in one direction. The CURRENT pointer 
is the only pointer needed by the polling routine. It always 
points to the data for the next terminal to be handled. 

Two-way circular lists are especially nice in FIFO queue 
management. Instead of chaining device requests and holding 
two pointers (or searching out to the chain end to make 
additions to a chain), we may build a ring from a fixed 
CURRENT element in one direction (Fig. 5). When the 
CURRENT element is deleted, the next element appears from 
the other direction. 

Fig. 5: 2-way FIFO Ring 




1 sA/e 


C. Current request 

processing is finished 



D. Next request is selected; 
request just finished is 
then freed 


Trees 

If an element contains more than one link (not counting 
backward pointers), a tree structure results. The tree’s data 
elements are called nodes. The starting node is called the 
root-node (see Fig. 6). In moving within a tree, down means 
moving away from the root-node towards peripheral nodes, 
and up means moving towards the root-node. This is, perhaps 
unfortunately, exactly the opposite of nature’s convention. 


A. Ring before 
interrupt 

poiMteA limk 
pa-ta A 



B. New request 
enqueued 


Fig. 6 



Number 24 


Or. Oobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 7 

155 























However, as in real trees, the most peripheral nodes are called 
leaves or leaf nodes. A “family tree”, such as you might have 
in an old family bible, has this structure. The leaves are the 
latest generation. Not surprisingly, the higher nodes of a tree 
are called parents and are said to have children or descendant 
nodes. A subtree refers to some parent node and its 
descendants. 

Moving down a tree involves making decisions; moving up 
simply means remembering where you came from. CAI 
routines often use trees. A node representing a question and 
its answers is linked to other nodes. The choosing of one of 
the answers causes a particular descendant question to be 
referenced. Another subtree from this node is selected in the 
same way. This continues until the user reaches a leafnode. 
Different students might be asked entirely different questions, 
except for the first root-node question, of course. 

Storage and retrieval using a tree can be very fast, especially 
for large data bases. This is because fewer tests are required 
in searching. If every node has no more than two descendants, 
a single test may narrow the search to half of the remaining 
nodes. Trees are useful for managing symbol tables, efficient 
use of diskette storage, and maintaining ordered data which 
is constantly being changed. The many uses of trees really 
deserve separate elaboration. 

Other Stuff 

It is often better for list elements to contain a pointer to 
data instead of the data itself. If the data to be linked is 
already in memory, just allocate enough space for linkage 
pointers and a data-pointer, insert this element in the list, 
and store the address of the data in the data-pointer. This has 
the advantage of allowing several lists to reference the same 
data, thus saving the duplication of data and conserving 
memory. Carrying this idea one step further, each link may 
contain a key. Several different sorts of key can be referenced 
in several lists. Suppose an art store wishes to be able to 
reference a customer file by customer name and account 
number, and also wants to be able to keep track of which 
customer had purchased any particular work of art. Lists for 
names, ID’s, and sold artworks could be maintained in order 
to reference pointers to information on the customer they 
match. Such a referencing scheme for JOHN DOE, whose 
ID is 99M999, and who is the owner of two works catalogued 
P801 and Q003, is shown in Fig. 7. The lists from which the 
links came could be chains, trees, rings, or compounds of these. 

Fig. 7 



Multiple References to the Same Data 
Using Several Lists 


It may not be easy to apply all of these ideas immediately 
in your own systems. However, even if you are just learning 
BASIC, take heart! There are a few tricks that will carry over. 
Remember the bubble-sort? A one-dimensional array (a 
vector) can be used to store index values to another array 
which contains the records to be sorted. Swap the indices 
in the first array instead of moving the data. After the sort, 
the first item will be in some position in the data array, and 
that position will be indicated by the first element of the 
first, index, array. Similarly, the second element in the index 
array will indicate the position of the second item in the sort 
sequence, and so on (Fig. 8). 

Fig. 8 


A _ 


51AITH 



z - 

- 

JO/dE S 

3- 


ta yl&R 

4 " 

--^ 

4 BEL 




1 — 

4" 

v 77 

5>A1 IT hi 




'JPAJE 5 

3 — 

1 - 

A 

T AY LC? K 


3- 


ABEL 


At=tek soar 


Sorting Using Subscripts 

Now, with all of these new tools, you should be just about 
ready to start designing that great new system that’s been in 
the back of your mind all these months. 

Happy linking! 


MAILING LIST PACKAGE FOR NORTHSTAR 

News Release Received: 78 Feb 22 

The Comprehensive Mailing List Program Package #ML- 
1NS, is a modular program set which enables the user to start 

and effectively maintain one or more mailing lists. Operations 
include: Add, Delete, Search, Sort, Auto-Sort, and Sequential 
Printout. Features include: user-selectable defaults for ease 
of entry, user-selectable number of labels across page for 
different printers and label sheets, and user-selectable 3 or 4 
line address for each independent entry. The program set is 
written for convenience and ease of use. Available with 
complete documentation and North Star diskette (SWTPC 
version available soon) for only $25 PPD. Documentation 
package only is $4.50 PPD, fully refundable with order for 
diskette. Order from: Williams Radio and tv, inc., computer 

Division, 2062 Liberty Street, P. 0. Box 3314, Jacksonville, 
FL 32206;(904)358-3707. 


Page 8 

156 


Dr. Dobb's Journal of Computer Calisthenics 8< Orthodontia, Box E, Menlo Park, CA 94025 


Number 24 









»*#**#**»»»»»»»##*#»»**#####»##»###*#*#########*»»»»»»»»»»»»»»»»»»»»»*##»»******»»*************»»****»******»******»»' 


THE OZNAKI "LIFE" 


An interactive version of LIFE for the POLY-88 VDM 
INTRODUCING THE NAKI CONCEPT FOR TV GRAPHICS 


BY HARVEY A. COHEN 

OZNAKI Project 
La Trobe University 
Bundoora 3083 
Australia 

Here is a version of Conway’s classic (i.e. 1969) game of 
LIFE that has fairly advanced interactive facilities — one can 
play God with aplomb - yet the program is less than 200 deci¬ 
mal bytes long, and when running uses only a few bytes for a 
stack and the IK of memory in a Polymorphic Systems VDM. 
(I eliminated the need for a IK next generation store by 
“marking” the screen itself — indicating which live cells will die 
in the next generation, and which dead cells will become alive 
— without interfering with the neighbour count algorithm.) 

The key idea in running the LIFE is that there is a little 
screen creature — a NAKI — which can be commanded to move 
about seeding or unseeding the screen. A more sophisticated 
NAKI might drag a picture (e.g. a rocket ship) about the 
screen, but that’s not called for here. 

When this game is started the player is presented with a 
clear TV screen. On pressing the E key, a NAKI appears on the 
upper-left hand corner of die screen. The NAKI can be driven 
about (and off) the screen using the commands: 

N NORTH! 

S SOUTH! 

E EAST! 

W WEST! 

The NAKI will populate (“seed”) the screen cell it current¬ 
ly occupies in obedience to the commands 

L LIFE Deposit an asterisk 

K KILL Blank cell 

Just what’s underneath the NAKI is not visible until the 
NAKI moves on, or LIFE is started. The whole screen can be 
cleared with the C command. When you are satisfied with the 
way you have populated the world, you may grant it LIFE — 
an autonomous existence determined by savage laws — by key¬ 
ing in the command G. 

G GO 

If you want to “single -step” — instead of G use the com¬ 
mand H: 

H GO ONE GENERATION THEN HALT 

The pattern is steady for about two seconds, then the cells 
are marked for change. A dead cell in which life is to appear 
in the next generation is marked by a solid blob. While a living 
cell that is going to die is marked with a three-pronged graphic 
character. (The display of the marked generation could be 
eliminated by removing the corresponding CALL DELAY 
in the program.) About 2 seconds later, the next genera¬ 
tion appears. Here is what happens to a set of traffic lights. 





■ 

1 

iii 



i 

< 


■ 


Even though the Birth-Death agony sequence was started 
on the G command, the display will halt on the next genera¬ 
tion by making ANY keystroke; once the display halts, this 
keystroke is obeyed if it is a valid NAKI or LIFE command. 
Elsewise, once the display has halted, the NAKI is sitting just 
off the screen, and may be brought back onto the screen to 
reseed or kill at your whim. 

For those who haven’t met LIFE before, the following 
details may be useful. Each of the 1024 cells (character posi¬ 
tions) on the screen has 8 neighbours. Cells with 2 live neigh¬ 
bours are stable, whilst if a cell has exactly 3 live neighbours it 
will hold life in the next generation. Elsewise the next genera¬ 
tion in that cell is dead. These are the usual rules for LIFE, as 
per Marvin Gardner’s articles in the Scientific American in 
October 1970, and February 1971. Gardner’s articles include 
pictures of the evolution of several interesting LIFE “worlds”, 
including gliders and glider guns, pulsars and pentadecathlons, 
and a host of stable patterns. In this implementation the 
screen is large enough to display a glider gun, but the gliders 
ejected bunch up and destroy each other on the screen bound¬ 
ary. Conway’s LIFE is played on an infinite lattice. In this 
LIFE, off screen neighbours are always dead, and there is a 
crude wrap-around on the screen sides. 

Note that this program will not corrupt any location in 
memory other than the actual program storage space, less 
than 10 bytes of stack, and the VDM of course. 

The program can be adapted to use the Processor Technol¬ 
ogy VDM, at the price of a modest increase in length, which is 
then needed to properly count off-screen neighbours as dead. 
A non-interactive version of LIFE on the P.T. VDM, written 
by Marvin Wizenread, was printed in DDJ November 1976. 
Unfortunately, Wizenread’s program, if unaltered, will corrupt 
any memory within 10K or the top of the VDM. 

I wrote this version of LIFE to provide a demonstration 
piece that proves that pretty interesting things could be done 
in tomorrow’s schools using 2 chip microcomputers. The 2 
chips of this mythical computer would be a CPU with IK 
RAM and IK PROM like the Intel MCS-80, and a video chip. 

Number 24 


l 


Page 10 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


157 






OZNAKI PROJECT CROSS ASSEMBLER OUTPUT 
INTERACTIVE LIKE ON P0LY80 
LIFE P8« 18-AUG-77 13133 

SYMBOL TABLE 


A 

7 

ALIVEC 

AA 

8 

0 

BLANK 

3003 

C 

1 

Cl 

306C 

CLEAR 

3000 

D 

2 

DEADC 

7F 

delay 

30AS 

deloop 

30A8 

DHARK 

308D 

EAST 

309B 

H 

4 

KBUPF 

C0C 

KILL 

309F 

LIFE 

304 A 

LIVE 

30A2 

LIVEMA 

80 

LMARK 

3092 

M 

8 

NARK 

3088 

NO 

304 A 

NORTH 

3097 

ONECCN 

30B1 

RE AD In 

3013 

READY 

300C 

SOUTH 

3099 

VDH 

F800 

VDNU 

F8 

NEST 

309D 

NHB 

C20 


s m re o> 
SflN<KU s SKU 
u cm kJ ea lj 

U. 3* "1 ® JO 


t- <n to e> 


- r\ m o < o u. <s — 

3 S3 X> CO CO ® CC » Oi 

raa 333333 

m m io m o n 


CM ^ «f» <0 
o» o» Ol » 
a a a a 
nmno 


moo < b u o ui u. —• cm ■> 
» » » o» o> o* » aa<<4 
aaaasaa 3 a a ia a 
m n m m m m m nimnnc 


IO«KOOi<!DUU.B'i«nOKC 3 

< < < <<<4<4IHI011CQ])00 

aaaaaaasaaaaaaaa 

nimnnmn'iini'iiniiinnmnin 


M 1C Q 
< « bJ 
ui u n 
kk a 


a or 
o u 
<o t 


z o s 

►4 X ® 4 

o s u. s < 


3 *4 
M I U 

♦ 30 
X X < 

c ou 
> > o 


uuunu 
or ar ® 
o o o or 

0 00410 

< _j < x »- 


4 X 

o o 


X X 
*- ui o 

a*-z 

X Cl 
Z ■< W 


(TOO 
< *- »- 
z co co 
uuu 
-or a- 


X o 

♦ owes 

CO X X Z UJ 

407WMQ 

UJ Z *1 X X o 


3c M« Oc 
1 O UJ 4 JC UJ 1C i 
CO * ill X * 


arxrxToroxirxxr 


x x 
< «, 
9K0X4 


< ►- U -I 3 

j< x > jI i a 
o ui uj - i-i *-« »o—o 
r7aox<<jic« > ul 


>- z u. 

■* < u. 

3 0 3 


uun ■ 
-IX ■ 3 
*-<ux r 
►4 uj o o o 


LJ u 

>• o 

>-«<»-t*-4*-»>4Q.f 
3UiX»>OX i 
< o _i x r o o - 


m a 

L Z O 

JT 1 


a o o x a > 

1 4 Cl C O . 
4 O <«"•<►■ 


3 OO O O X O X O X 13 »-« 1-4 IM » « j B X > 4 UI O > M NO _ 
-'CiUCUOUC.' <.'U/’G.'N< oUOaaiLClL —■ < 

I04Q4Q404Ha4UUI <30 •40X000X03—0 


OKu-ffiosnu. 
U.U.MVBO jJU. 

amxu.su® ® s 
au.<pM®foio 


<M «4 -4 


-susnninsNamauaosBSKs- 
Nonnion^inininMOMnMinMOMin'j 
JUNLOUlCUOU'xUNUSU-UKl 
.. — • — • — L JU.5ll.4U su mu- 


l3iU.3U.Ju 


muressores 
niMEnn\u.n 
CM U. UI O 


snciKOPoQ am 
33303333 — — 

333 3 3 333 33 

oimnomonn com 


Oi4OUHO0OBO3ftlinK4OU.4»iOBi4 4lllOOU. 
rt-^rtNiuNMucunininooinoMM^ < < -mmmi ^ 
333 3 33333333 3 33333333333 3 33 
nnn , n>Tnpnnninin'ininni l ino»inininnrvnnn 


us — NinvinoNOo < iuu.sm4 ® ci 
'IB.TClClCl.'lClO.TinOOBOCOOOC 
33333333333 3 3333 3 333 
nnnmnnninn'iinnninnininininn 


O O w U. <M IT *0 O X) U 

OOdCNSNN re K 

33333333 3 3 

oominooinin o in 


Number 24 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 11 


158 











A IK DEBUGGER for the Z-80 


BY LES HANCOCK 

305 Lexington Ave 7-C 
New York, NY 10016 

The IK Debugger is really a 0. 951 17188K debugger. This 
version is assembled to start at 074061 octal. That puts it at 
the top of 16K, up out of the way of most programs. The code 
must be assembled to end at a page boundary (***/377 octal, 
**FF hex). The debugger is meant to run on a Digital Group 
Z-80 system with ZE audio ROM, TVC-64 video interface and 
TVC-64 monitor. 

This debugger provides the following features: 

• Display the contents of every Z-80 register as it was 
at the moment the debugger was invoked. 

• Display the current contents of any memory location, 
using extended addressing, register indirect addressing 
or indexed addressing. 

• Change the contents of any register buffer. 

• Change the contents of any memory location in RAM, 
using the three addressing modes mentioned above. 

• Load the Z-80 registers from register buffers and 
jump to any address, with or without enabling inter¬ 
rupts and with or without setting a breakpoint. 

• Load the Z-80 registers from register buffers and 
jump to the most recently set breakpoint, with or 
without enabling interrupts and with or without 
setting a new breakpoint. 

• Jump to Op Sys program/dump, with automatic 
return to the debugger. 

• Swap contents of register buffers with Z-80 alternate 
registers. 

• Display any 8-bit value in binary notation. 

• Give the two’s complement of any 8-bit value. 

• Add or subtract two 16-bit values in split octal or 
hex. 

• Display or set mode (hex or octal). 

• Clear TV screen. 

This is a simple debugger, and using it should be fairly 
straight-forward even for new programmers. Get an assemb¬ 
ly listing of the code to be debugged so you’ll know the 
address of every instruction. Load TVC-64 Op Sys, debugger 
and target program. Create a new Op Sys option to jump to 
the debugger, then use execute and breakpoint commands to 
run your program piecemeal. Whenever it reaches a breakpoint 
the program will return to the debugger; try the various dis¬ 
play commands to see exactly what’s been happening in the 
CPU and in memory. You may want to load new values, then 
jump back into the target code. You always have access to the 
system program/dump (via the ? command) to do extensive 
reprogramming or to display large blocks of contiguous 
memory. 

When you jump to the debugger it resets the stack point, 
disables interrupts, and inserts the debugger’s start address at 
001025—001026. (This last step vectors RST 070 back to the 
debugger.) Then it loads a set of buffers with the contents of 
the Z-80 registers, removes any breakpoints that may have 
been set, and waits for input. If you want to re-enable inter¬ 
rupts, use the XI and ZI commands; if you want to keep the 
stack pointer at its original value, use SP = nn. (This paragraph 
may not make sense first time around. Reread it after looking 
over the list of commands.) 


The input prompt is a six-space indentation, a la APL. You 
can type in up to 20 characters per line, including blanks and 
the carriage return. (Blanks are ignored when a command is 
decoded.) Use the RUB key to erase typos. If necessary, rub 
right back to the beginning of the line — you can’t go past it. 

The error message is a question mark. 

A few words of caution are in order at this point. When you 
look at the load commands you’ll see that there’s a big differ¬ 
ence between changing the contents of register buffers and the 
contents of memory. If you give the command A = 015, what 
you’re doing is loading 015 into a buffer, which will in turn be 
loaded into Z-80 register A when you give an execute 
command. But if you say (001001) = 015, you really and 
immediately put the value 015 into memory location 001001. 
Think twice. 

When you set a breakpoint at a certain address, the debug¬ 
ger copies the byte it finds there into a buffer and replaces it 
with 377, which is the RST 070 instruction. This restart is 
vectored back to the debugger, which will take out the 377 
and restore the original byte. Be sure that the breakpoint 
address you give points to the first byte of an executable 
instruction in the target program, or that program will surely 
bomb. If it does, for this or any other reason, then control 
won’t return to the debugger, and you must remember that 
the instruction at the breakpoint address is RST 070 and not 
the original article. 

The Z (or ZI) command allows you to jump to the most 
recently set breakpoint, which means the last breakpoint set 
since you loaded the debugger. Be aware of that, and of the 
fact that if you jump to a breakpoint and set a new breakpoint 
at the same address, you’ll bounce right back. 

The debugger prefers to work in octal. You can switch it to 
hex with the M command, but it will reset itself to octal mode 
when you come back from a breakpoint. If you enter a hex 
value in octal mode, you’ll get an error message; but an octal 
number may be accepted when you’re working in hex, with 
incorrect results. 

1K Debugger Summary 

Conventions : 

Punctuation marks, math symbols and capital letters must 
be typed at the keyboard just as they appear here. 

Lower-case n stands for any 8-bit value, nn for any 16-bit 
value, d for any 8-bit two’s-complement displacement. When 
the debugger is in octal mode these values will be given in octal 
notation, when in hex in hex. 

Brackets indicate a choice. For example, {± ) means that 
you may enter either a plus sign or a minus sign. (But you 
must use one or the other.) 

Square brackets enclose optional entries. For instance, 
H [L] means that you may enter either HL or just H. 

Input : 

The debugger prompts for input by indenting six spaces. 
The rubout character (377) backspaces the cursor and erases 
the previous entry. You can type in up to 20 characters per 
line, including blanks and carriage return. When a command is 
decoded the blanks are ignored. The 21st character creates an 
error condition, and all input is scrubbed. 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 24 

159 


COMMANDS 


Register indirect addressing 


1. SCREEN CLEAR COMMAND 


2. MODE COMMANDS 


2.1 Display Mode 


2.2 Set Mode 


Clears TV screen. 


Returns H if mode is hex, 0 if 
mode is octal 


0 sets octal mode, H sets hex 


HL Returns the value currently 

BC stored at memory address speci- 

( DE ) _ n fiedby the contents of the 16-bit 

SP register buffer 

.C Indexed addressing 

IX 1 Returns the value stored at 

( IY | + memory address specified by 

contents of the 16-bit buffer, 
offset by the two’s -complement 
displacement d. The plus sign 
may be any nonblank character. 


5. LOAD COMMANDS 


3. ARITHMETIC COMMANDS 


3.1 Binary Display 


3.2 Two’s Complements 


Displays n in binary notation 


Returns the two’s complement 
(NEG) 


3.3 Addition and Subtraction 


5.1 Load 8-bit Register 


Loads the value n into the speci¬ 
fied register buffer. 


5.2 Load 16-bit Registers 


Loads the value nn into the 
specified 16-bit register 
buffer 


± nn, nn 


Using reverse Polish notation, 
finds the sum of two 16-bit 
values or the difference between 
them. The comma may be any 
non-blank character. Note: octal 
arithmetic is done in split octal, 
where 000377 + 000001 = 
001000 


4. DISPLAY COMMANDS 


4.1 8-bit Register Display 


Returns the value currently 
stored in the specified register 
buffer. Command 3.1 may be 
used to interpret F 


4.2 16-bit Register Display 


H [L 
B C] 

D [E 
S[P] 

IX 

IY 

4.3 Memory Display 


Returns the value currently 
stored in the specified 16-bit 
register buffer. Note that L, C 
and E can’t be displayed as 
single registers 


4.3.A Extended addressing 


Returns the value currently 
stored at memory address nn 


5.3 Load Memory 

5.3.A Extended addressing 

(nn) = n Loads the 8-bit value into 
memory at the address 
specified by the 16-bit value 

5.3 .B Register indirect addressing 


Loads the 8-bit value into 
memory at the address 
specified by the contents of the 
of the 16-bit register buffer 


Indexed addressing 


+ d ) = n 


Loads the 8 -bit value into mem- 
moiy at the address specified by 
contents of the 16-bit buffer, 
offset by the two’s-complement 
displacement d. The plus sign 
may be any nonblank character. 


6. EXECUTE COMMANDS 


6.1 Execute from a Given Address 

X [ I ] nn Loads the Z-80 registers from 

the debugger’s register buffers 
and jumps to address nn. If the 
command is XI, interrupts are 
enabled 


Number 24 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 13 



6.2 Execute from Last Breakpoint 


Z [ I ] Loads the Z- 80 registers from 

the debugger’s register buffers 
and jumps to the most recently 
set breakpoint. If no breakpoint 
has been set, control passes back 
to the debugger. If the command 
is ZI, interrupts are enabled 

7. BREAKPOINT COMMANDS 

7.1 Set Breakpoint and Execute from a Given Address 

X [ I ] nn, nn Loads the Z-80 registers from 

the debugger’s register buffers 
and jumps to address specified 
by the first 16-bit value, with 
breakpoint set at address speci¬ 
fied by the second 16-bit value. 
If the command is XI, interrupts 
are enabled 

7.2 Set New Breakpoint and Execute from Last Breakpoint 

Z [I] , nn Loads the Z-80 registers from 

the debugger’s register buffers 
and jumps to the most recently 
set breakpoint, with a new 
breakpoint set at address speci¬ 
fied by the 16-bit value. If the 
commands are ZI. Interrupts are 
enabled 

7.3 Display Last Breakpoint 

E Displays the most recently set 

breakpoint, the one to which Z 
or ZI will jump 


8. DUMP COMMAND 

? Loads the Z-80 registers from 

the debugger’s register buffers 
and jumps to address 003000. 
All the usual monitor program/ 
dump functions are available, 
but the command R will return 
control to the debugger and not 
to the monitor 

9. REGISTER SWAP COMMAND 

& Loads the Z-80 registers from 

the debugger’s register buffers, 
then swaps them with alternate 
registers and returns control to 
the debugger 


FOOTNOTES TO THE CODE 

1: Line 180. The TVC-64 monitor vectors RST 070 to the 
address contained at 001025 — 001026. We want that to 
be the debugger’s start address—in this recension, 074061. 



2: Line 270. The byte at 001247 is a mode code. If it’s 
ASCII ‘H’, the current mode is hex; if not, octal. 
Subroutines NUMOUT and FINDMO, and the mode-set-or- 
display routine SHOWMO, make use of this Digital Group 
convention. 

3: Line 370. When the debugger is initialized, FLAG and 
FLAG + 1 contain a jump instruction as shown. As soon as 
you set a breakpoint, that instruction is replaced by a NOP 
and a load-HL-immediate. ZBP and ZBP + 1 always 
contain the address of the last breakpoint set. (It’s 
initialized to the program’s start address.) BPBUF contains 
the byte located at (ZBP). When you come back from a 
breakpoint HL is loaded with the breakpoint address, A 
is loaded with the byte to be replaced in the target code, 
the byte is put back where it belongs, and the instructions 
at FLAG and FLAG +1 are reset to JR NN0. 

4: Lines 430, 1070. Users of TVC-64 return from the system 
dump by jumping to the address at 003376 — 003377. 
This is normally 005000, the monitor’s entry point. The 
debug command *?’ will substitute the address NN0. So you 
can go straight into the excellent system dump, use all 
its features, then return to the debugger without disturbing 
the contents of the register buffers. 

5: Line 3290. This subroutine was cribbed from Dave Bryant’s 
PHIMON listing, published by the Digital Group. (PHIMON 
is DGI’s Phi-Deck monitor.) I changed the code to work 
with TVC-64, but the hardware is a mystery to me, so 
I’ve left out comments. (This is another way of saying that 
I don’t know how the subroutine works.) 

The TVC-64 support routines used by the IK Debugger are 
as follows: 

TV—prints ASCII byte in the accumulator on TV screen 
SPACE—prints one blank space 
ERASE—clears TV 

KEYBD—gets a byte from the keyboard 
NUMOUT—prints the value in register E as two hex digits 
or three octal digits, depending on what’s in 001247. (See 
note #2.) 


Page 14 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 24 

161 


Q. -u X <D X 
•X Dn Qj -u 0) 

•Q X) .q a .q 


a i 

■r-,Tj q fc< 

TJ -C X Q) 

C O O Q, 3 Cn 

-x -x >tj *j 0< 

. CM3 

S O i 0) X 45 

Ofi *J 0) 

fa v .. tj -t> 

a: a, q> fa q _ 

6 c 2 nj 'x 

0) a x fa o <x 

X T> 44 fa U) 

O 3 X X «* 

X**O«0fl)X- 

tn X X q -u u 

QJ X <fl x *J 

« «M O 3 'X (ft -X 

in X Cjuj tn 
<D 3 I <U 0) O lo 

X) m x x -u n 


q J< Q) -u fa i 

•x C x O H I 

a t C u X; 

■X -X X 

XJ O ITS O fX 

S k “ V 


w x «i to 

0) QJ QJ tfl QJ tfl 

Jx q fa fa lx H : 


3 

Z A 
X CD u 
Z M Z UL 

o ‘Ha: 

UA JUI. 


XL 

I X- UJ A 
10.0.0 Z N 
• X Q£ X- A ~ 
oxL' - - : 

I 3 Z UJ N 3 
Z X l 


t *. « Z W ~ © N <£ ~ ' 10 3 3 3 

30 u o <r o o. z n in uj a. u. in a >o a n a o> o. 

o cd cn uj z o x z ro z x x <t z « z u. zo: z *x 

IZIO 'X'OC' * 3 *■ O ' * 3 »■ CM ' - - A ' - - Q - » ■> Q % * f- %X' 

U.X«NJZU.NJZOCNJZHNXUJXX - 3 
IZCQUJ' N ' N' Z X ~ X ~ o - ZX'-'O « 0) ' Z Ik' Z X U. ' Z X U. - ZHOH ' N> 


> ^^ IL ^ ll '^ &i ^ <k - £aa ^ LLa:Qfl ^ Q ^ aa ‘ & - a - a -^ lk -KQQflQ&-&-O.QQLl(XLLO:QI>:La:QO!LQ:aLLL3^0LLLLQ 

IUUTUTUlUT(JTJJUTUTJJUJUJTUTCJTUlJJJJTUTJJTIilliJTinjTUTJ”)(JTJTUTLULUTUTJ 


O O O O O O «X 

o x cm w v in in 
n n n n n n n 
o o o o o o o 


S59?2?9°5!22.9 0 ?2 0000000000000000000 oooooooooooooooooooooooooooooooooo 

XXNNNNSrnmSi5S!Smmm^^J!C^^?^ OHNr),rin ' OPsCDI> ' OHNM ^ in ' flNII,l> ' OHP,Mtln,ON ® (>,OHMn ^ ln, <I N ®'>'0^ 

©©0©00000000©0©00000©00000T-t*-»»H»H*H*-«*-»»HiX»H»-«»x»x»x»x«H*M»x»x*x»H»x»x»H»H»x»x»H,x. I H,x»H»H»x,H,x,-i,-iT*,HT-i»x 


o >o rx n 
-< <r o »x 

o own 
O'Oinru 

CMOhOI 

OOMMt 

Hioinot 

-O-O-OM 
PM CM CM CM C 

IX IX IN IX f 

o o o o < 


on <r 

ON N 

o o o 

in <r >o < 

'X t (N M 

ro o h in x i 

ino in in >o pm ' 

in ro ix h x x r 

O O I*) M 10 IO I 

n^r'O'O'O'or-jiONc 

NNNNNNOOO' 

PMCMCMCMPMPirororor 

<r'»r<r<r<r<r«r<j-<r< 

NNNNNNNNNf 

ooooooooot 


NNN <r>0N'O <T CM CM W -0 m 

NNN NNNN NOONNN 

ooo oooo oooooo 

<r<rincM'0NCM* > <r«-'0'0ino*- -o 'OCMioonownn 

(MMxinxxMHinonooiMin o on cm n >oinroNH 

MNnHrmnoHMHNMOH *x HomnncMioNo 

'OPM'OPM'OCM'OOCMCMinrO'OOCMVininin'OrO'OCM'OCM'OO 

NHNHNHN<nn<rHON<nnnHt«ixooNHNHNT 

MnNnnMMOooMMMOOHnHnoMnnnMMO 

fMNHVMjxninoi'i'OHninoH^inoNinNCMtNx 

HHHM(MiMnnn'r<r<rninin'0'0'C'ONNNNooo« 


M'O^n'O iniO'0'0 
ONNON NNNN 
OOOOO OOOO 

o^O'O'O'omo^-'O 
lOONNtt ninot 
lonxncMCMooncM 


fMNH^-oxninow'OxninoH^inocMinNCMtNx 

HHHNCMiMnniottTininin'O'O'O'ONNNNoooH 

rororororororororororororororotorororororororoooo© 

o-;*<r<r<r<r4r<r<r4r<r<r<r<r<r<r<r<j-«-<r4r**-inininin 

NNNNNNNNNNNNNNNNNNNNNNNNNNN 

ooooooooooooooooooooooooooo 


otp-O'O'OinoTM) OHinoO'OnNNNn«o>OHM)intrxOHHCMn 

ooNN^tninot NOo-oinooinncMOOCMxMJtcMtntnt'O 

OMhWCMCMOOWCM OnONOnONOnOMOMOMHlDnOMOIM 

H(MHCMro-o!MH(MnHOM>ooHO'OoxO'OOHO'Ooinnin' 00 'OOH 

tt^^oNOttonHONttnNttnNttWNtNHNNinNinv 

oooorororooororoororooooroooorooooroororororoorooo 

ID'Dx^NCMtNCMinOxCMinNxt'OOCMinNxrO-OOCMt'OxmnNxn 
HHCMrMtMnnnwinmninin'O'O'ONNNNoooHHXHCMCNCMCMnn 
0000000000000 000000000 <x*H«x^«x«x«x«x*x<x*x«x«x 

ininininininininininintf}ininininininrcininininininin«inininbnninintt 

NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN 

ooooooooooooooooooooooooooooooooooo 


QJ JD >X UJ H 

X X q <g ^x 

o u m 

to C X JI QJ 

0 X) 4J -U 

. 3- > 

X X X C C 

to to to to *X 

QJ -U -U -U 

to q q q to 

(Q M ■», 4J 

, X X X X QJ 

fa fa fa fa e> 


'O CM O “O O 

■ <r n n o in 
ro ro ro »x cm 

■ o o o n h 

OOOOO 

■OOOOO 


3 3 3 3 3 U. 

•aocoo 3 

lu u uj lu u a 


0) X ~ 

- - in 

~ ~ cm 

U. X- U. K O 

3 cn 3 CD x 


1 U. U. U. U. U. 

• 3 3 3 3 3 

* h a o: a aaa 

> - XH » £t J |l N A 

<X~<T'-'X'-'~~ 


U. lOIO'' 

3 O •■ O M) 

a <x «r ~ m n 
Q. ‘HCDOIOLI 
A^OQIOIOW 

o ~ 3 * 3 - o « 

Z X- 'I Jli. JOL 

zcn<r^x — x^uj 


A X- <X 

A Z Z X - A 

WOHH Z ~ GO 

O ZCM - >- m * 3 ro 


uj o cn 

« Z CJ N - 
► H QJ N N 


XXX 

cn a. cd o. cn 

QQt-tAAQ30Q30Q3QQi 

JjajJJLa.Ju.ij_lu_13. 


uj u 3 a <r 

cn a o a o 

<t <z r >- 3 PM 

CC Z> (L 3 UJ X- X- 

UJXCDZZ1MMHD CO 

• -rxPMrOO-IO'ONAOOOOOOOOOOOOOOO 

iwroroioioroioiO'ryD'ONCDD'OxcMioirin'ONCO 

i ^ ’X »x th tX tx tx ^x »h »h pM C^‘4 CM CM CM P*J CM CM 

• OOOOOOOOOOOOOOOOOOOOOOO 


‘W » JIIIHNI » * X UJ ^ in - a x _> 

A JAIZIMZvQOlia _JQIOZ_JN_JAAr-CJ'-'l- 

-J -J -I 3 3 3 

3 3 A 3 UUU33 3 

AtXAACCLCCAAAA <1 C£ L Oi Z CC Z Z « « ^ A <1 

3(J33UU"133Q3 U3U3>-h-Q > -)»-iUU33U 


OOOOOOOO^PMIOOOOOOOOOO^CMrOO-OOOOOOOOOOOOOOOOOOOOOOOO 
?2i2! n,, ' in ' 0 ' 0 ' < >' ON ® | > , O r, ^ ,, ’tiniflioinin'ONfflo>OHPMio^in'ONAi>'OHMio , ryi'ONCDO> 
CMiorororororoiororoiorororo^ro-^-^'^-o’^'O'O'^-o-^’^ro'ioioioiombTUTininin'n'O'O'O'O * * * - * 
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO© 


'O 'O 'O -n 
OOOOO 


*x -o *f x 

ON N N O 

ro o ooo 


•o <o >0 >0 

OOOOO 

O-O-O-O-O- 

N N N N N 
OOOOO 


ro ^ o x in in o m nnnion , o n ro ro 

'O'O N'OPmo* in^- m x ^ pm >0 10 o in o cm 

»x o pm o o ro pm ro cm ro pm th pm ^ ro cm^^ 

in»xiopM'xcMin»xCMin^xCMin'OCMincMincM*-*CMinin 

in'O'Oo-o-o-ro^-o-No-o-'ON'Oin'Oin'Oo-o-iniio 

rooroooororooroiooroooroorooroororo 

HHHXHxxHxinOxtrNPM^inOtMIO'ONH^MJxrO'ONPM'ONPM 
-O'O'O'D'O'O'O-D'O-ONNNNOOOxxHHHNPMPMIOIOIOrOl'triilin 
OOOOOOOOOOOOOO HXHHHHXHHHHHHHXHrlHH 


n t vinroo 

N »x N O O © 

O OOOOO 

o- tr OCMO'O'O 

hnio ioinoN» 
o o ro o ^ o ro ro 

OxCMNxCMxCMin 

lO'ON'OtM’ttrx 

ooo«xooooro 


•ON^-NinwcM >o 

O O (MN H H H *■ 

oroororocMO o 


N CM N in ro *x PM "O PM 

oo-Nth 5r ro n h is 

ro o ro o ro roroo ro 


u m m m m i\ u u u h h h h h n rj n n id n “ " id uj 

OOOOOOOOOOOOOvHvXT-tTXiXiHiXiXiHiHiXiXiXfXfX^^^T-t 

NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN 

OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO 


oxiMNxCMxcMin 'Oin>OHin'OON'OOMiTO'00vo<i-trininoMn 

N'GN'O^^^ Vx OxOtHNt'ONOO^MNtnilininOHxn-OH 

ooo^ooooro onoonno«xoCM^nonooooonnorHro 

pMPMV'OxcMinon'OxHHHHn'OOM'OoiMMin'ONCMV'OOxrovinomn'O 

inininin-o>o>oNNNoooooooHHHCMCMN(MtM(MroroMv<rM i «r^inininin 

’X »x »x »x »x »x »x t-< CM CM CM CM CM CM CM CM CM CM CM CM CM CM CM PM PI PM PM PM PM P J PM PM CM PM PM CM 

NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN 

OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO 


Number 24 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 15 




« to -f TJ • 

« « m c tj 

l) M m q 

l-i w. o -i 

Ta tj o O 

T3 T3 CQ 

<0 <0 M &> 

_ O O QJ 

■O U *J v. 

«j id x q 

• * TD 0) O Qj ' 

«J C « -u C . 

I T3 QJ to -H 

c -u o 0 ) a -u 

-h x i -u e 3 


q 4J *J ' 

i a-" 1 

U 0) Qj T3 

<l) M o c m 

■U M S: m O O 

to 0) *~i *• *-f 

'2 ^ O O D, o, O 
t» <*h -*j to o "o -u 

Qj3qu-~ioqq. 
^ ■ft •n m ‘B N HJ ••-< 


4J 3 o q 

y x 6 q rv. o u 
tn <a -c u -U o 

q to -u \ *j • 

O X O O X U 

■u 0) QJ &> QJ 

q X O q u -q Qj 
*H O ■*-* •-* *• Is 

q <j 4 j wiJO- 
O' -~i QJ to QJ Qj 4J 

H Q 15 H X 15 to ' 


00 3 3 

- Z 2 

Z Cl <X X < 


In 3 >03 rx 3 003 

Hfi v* iZl ■>-! iXl H IXl 

2 I ic z n ce zqk z cn u. 

- - Q ' - Q % * Q v .. .. Q 


X. ~ ~ 

3 _J _J 

Z X X 

-X V w 


X 

O CJ U 

' * - Si. -‘O' - -Q' 51-' X' 5-a: » X i £ oot « ® « « ® q 5 i Ji-hhiimxur!<ri3 

XNJ2fiNJ2QNJ2WNJ2ldX ►>■ ►CCJXJUJUJ »j »CJJ fc O ‘ *• _J 3 - _J _J CJ Z Ci •. _j »■ UJ UJ UJ —< •- UJ ® u£ *■ *-3 •. <v 

% 2 X *-* ' zx»-*' ZX>H' ZX H(5» M' NUJXXXOZUXOBXfDNU U^KflUZICQH Z UXC6OOOWN2v0.«LJ2«iUI 

i-i 

-i _i_ix x 1111 I 


3r<r-'»- uj 

UJ _l _l U3-H03Q J- 

o: i x x z ~ ll » 3 

►i w vhh(-nwxui''«i'0 cj 
a -_i - uj uj uj h - uj co it •- »-3 - ct. uj 


-J _j _j u cn a. cj u: cj d tn n 

QCIi.CCQIl'Q.CI'fiiZ^Q.ltCQ.KQCaQ'Q^CaZQDOaLIZliJQOAKQQJOK 

3U3_J303_l3U03U33-J3-IUU_J«_| < l.tL_/U3Z-ix“T3«5°3 


OC CJ 

UJ Q Z 

t- _| i-t 

cn 


-J -I -I 
Q <t <1 <1 
_l U U U 


HACOLQi 
U 3 (J _J 3 _l . 


> O O O O < 
■OOO'OhC 

> O O »H sH . 
I CM CM CN CM C 


h N I*) O O 

O O O- O T-. 

m m m mj mj 
CM CM CM CM CN 


o o o o 
Niotn 
■O'O'O'O 
CN CN CN CN 


© o o o o o 

■OMDO>OH 

m> >o >o m> rx rx 
CN CN CN CN CN CN 


o o o o h cm n 
cn ro m- in m in in 
rx x. rx rx rx rx ix 
CN CN CM CN CN CN CN 


r HvoinoNCNinn'O^in'OinninH 
* M-CN^OfS^OONOOOrsrNCNOO 
> HHiOONHnONHlQOMOMOM 

JNOIO'OOHO'OOHO'OOHOMJOrt 

-Hr<)HNwnMr<rnNVfnNv<r 

iHOMnooowooonooonoo 

lOHrxONWNHM'OOCJtNHMn 

sixrxrxrxoooo^.n^cNCNCNCNnron 

innnnoooooooooooooo 

TinUTU’JUT'O'O'O'O'O'O'O'O'O'O'O'O'O'O 

•vrxrsrxrxrxrxrxrxrxrxrxrxrxrxrxrxrxrx 

>000000000000000000 


r* m> m> rx rx 

rx rx rx rx rx 

o 0000 

WO-OHN tow 

•oNMononinoincMH 

OhMOMOCMCMOCNhO 

oifl'OO'OOOHOHnio. 

MnNinMnn^mcHH. 

onnoroooooown- 

oMinrx^nmrxcNM-rxcMi 

<rv^^wininin'0'0'0M 

oooooooooooo* 

'OMJOM3M)M)M>M3M)M)M)M3- 

rxrxrxrxfxfxrxrxrxrvrsrsi 

oooooooooooo< 


O O O M- 
O O o 
OCNOH 


oo^OHinio<on'Oio^’<>'OOinNMnoNHioHO 

intotMVHHHtootONMnHininnHn^on 

OOOOOMM*iO^r0MOnOM»HCMf*)O^OnMO 

MinMNtNCNin'ONOHnt'OOtNM’r-OOHCNWt'O'fl' 

ninin'O'O'OVVVVOOOOOHHHHHCNCNCNNCNNNC 

'O'O'O'O'O'O'O'O'O'O'O'C'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O' 

^ l ^!^!^^ ,srs ' r ' rsfs,s ‘ ,srsrsr ^ rsrsrs ' rsrxrvrs ' rs 'f N 'f^rxf s r 

OOOOOOOOOOOOOOOOOOOOOOOOOOOC 


<r <r m- in rx <r r-i -o in in 

(N CN (N h o H o OrxCM 

HHHNOO CM t-i © m 


> >o in in in 
r o ^ 

> h M M M 


3 M> M3 M3 >0 
v rx rx rx rx 
>0000 


*o o in cm 
rx in ^ o 
moiqo 


•O'O'O'O 
rx rx rx rx 
0000 


m n cn rx in mj r 

5 O H I*) H O < 

> no h n o r 

h cn in >o rx cm * 
■) in m in in >o > 

^ H H H »H 1 

O'O'O'OO'O' 
s rx rx rx rx rx r 

> o o o o o < 


m- tx rx rx 
m> mj m> mi 

H H H H 

>0 >0 M3 >0 
rx rx rx rx 
0000 


I ~i --i 6l l, U -H 

1 <tj xj \ o i q 

*j 1 •* O u -1 • 

1 cj aj u u h] 

1 0 Qj *j qj *j 

O x, U c • 

. *J *J X) ' HJ -H • 

iQjqstoOQX- 
; 13 ■-! J5 X i J Q, I 


q xj x, 
•u -h 1 x, 
Qj u vo 3 


U. U. U. U. U. XU. 

o r <Z CC ~ b- 3 3 03 -H 3 CM3 1-3 

X 3 - K CC J3fi ® Ch *-.« 1 X 1 ^ CD < 1 * 

W2 ^ Cl UJIOh XO>-Q ZXQ ZQQ ZNQ XCO 

•- ' ► x j tin - '-r <o - z - z ' - »Z' - -z> - -Z' - - 

UJ I NUJIAhN - 3 - 0C_|i-<_|i-ilrx|_JHHCSM_Ji-iflCilxl_Ji-iU3NJ 

O ' ZZ~a.CNZUJZ®UJXU.XU.' Z X U. ' ZXU.' ZXU.' ZX 

-J -J -J 

-l-I -I 

<xa.C£€QCuCLGc:Q^QQ:Qa:i=iixcLC£QQ:Q.iXQa:a.iXQGe:a.Q.Q 

CJU->CJ_J-)CJ-3_IU_|-3_J-)_/-3CJ-)_J-)CJ-).J-3CJ-3_J->U-)_l 


o x •• r~ _j 3 a 

x z ~ a. x o 03 

CNi-incnocN x_j h r rj cm in 

- uj »-i - Cl - j UJ I j Cl a: - _] - 3 _j U. - ix: 
AOriNJAXZvXJiLAXUJZXJaUl 

_l N -J N _J N 

_j z (j-j u z a _i u z 
a^a.onaz^MUJ'Do.azaciinMA 
JUUTflJHUJBQTjHJUaajT 


cn ro uj cl 

- ' M3 Z X >- 

cl - ^ ^ lc oc 

cn « 1 — a _j n. o 


cn jzq 
3 a <z o cl cc 

u. J <J u Cl (J ~1 


■C. Z » * * li. _J UJ -J * -M- -M- UJ UJ * * * CC 3 

-*CNmp00000000000©000000000000000000»-iCNro00000000000000000000«-«CNm000000^CNm00©0000 
•H^HCMn^in'ONfflo-OHCMrM'in'ONCDO'OHNnvin'ONcoo-OHNCMNCJMirin'ONajO'OHnnvin'OMDO'OHrKJCNfjMvin'ONOoajcDmo'OHWMvin 
^M-^vM-^M-^^^M-inininininininininin'O'OM)'OM3-n'O'O'O'orxrxrxrxrxrxrxrvrxrxrvrxrxa3ajo3C000CD03a3C0a3(>'O'C>'O'O'C>'i>'O'C>'C>'O'(>'C>'O'(>'' ,, “' ,v ^^^^' i ' 


O' o o 0 0 o o 

*-> CM C4 CI CN (N CN 


mj rx >0 

rx ix rx 

o 00 


in ix —* m m •oininoo^n 

cn n o - o -< m OMiininmvr 

HNOO NCM h hOhCNOCNO 

in •oomMQ'O o-cin-oono no 
h-oon t mhom vn vn 
ronoro^nno-iMoooooo 

•fl'O'O'OHninoHt'OOHfoonino 

MnnrovM-M-inininin'O'O'O'Oixrxrxo 

ItHiHCM 

mmminin^JininininiiTinininininininin 

NNNXNNXNNNXNXXNNNNX 

OOOOOOOOOOOOOOOOOOO 


oino(N»in<iHninnoi 

^orxmooNCNOorx~«( 

noNonoNonoNoi 

'OO^O'OO^O'OO^O' 

r\^r^rnfX5j-«rnrx«r5j-nr 

mooonooonooor 

CNM , '0*HroinrxcN*-'Ooroi 

oooHHHHfjrgrjnnr 

CNCMCNCNCNCNCNCNCNCMCNCMC 

ininininuTUTinininininini 

rxrxrxrxrxrvrxr^rxr^rxrxr 

oooooooooooo< 


cq m- in rx rx cm 
O CN ^ 1-* M3 O 
OhNOMO 


>inM300MjroinixnoroM3MM3inrooM30 
> ix in cn o <r ^ 0 yj cn o o <r ro ij-j cm o ro 
>ronoooom^HOOMoo-irooooo 


h X C-J X x H 

M3 rx rx rx o o 
o cn ro o ro CN 

h mi in m) in n 

M) N h O h O 

0 o n o m ro 


in n *r n h ih h 
vr o n x <r in cn 
n o h n n cn o 

in M) in o in M) o 
N O H N X X n 

nononno 


iiTXC'nninininxN'r'OorjM'OxofjnxortirinxrtMnnnMiownoinrQnninxNvMJO 
nnvrvr»vr«MrinininM)M)MiM)M)XxxxooooOHHHHHHrK<(NnnnnnnnvMMrin 
r-j cn C'l r-i cn cn cn cn cn cn cn cn cn cm cn cm cn cn cn cn r*> m to m t*j m i*> ro r*) ro ro ro to 10 r*j ro ro ro m ro r*j 10 ro r*j ro 
in yj in in in in in ut ut in in y-> in ut in in in ut ut in in yT in yT yi yi in yT yT yT in ui in y-) y-j in in in in in yj in in in in 
rxr-''rxrv(xrxrxrxrNf\rx(xrxrxixrvrxrxrxr'*rxrxrxfxrxrxrxrxrxixrxixrxfxixrxrxixrxrxixrxrxrxix 
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 24 

163 



0 O <N 

U U ~f -U -s 

■u -U O 0) U, 

» in o « bi 

HJ 4J 

C C -U V pH 0 

0 0 <u - **s c : 

t, tt » o <u +-> 

a; -u is is 3 

a w 5) o fl 

0) Q) .£} N 4J N — 

t> b> W) 

m m ^ 0) 

to to h a: 


■C Q) U 

*J is (\. «j qi 

O X *1 U 

<0 U Q> T3 Cn 


*■ T3 ^ -u 
8 8-8 


TJ <0 ID *j 'H Hi b 

is +j -c oi m c 
'aisoxj.qao:* 


c i» « *j o <3 

O C -1 t) 8 *J c 

*J O -C C Qj c -~l 

to O u H C 'S J3 


r o i 

3 r x 

Z Q UJ 

*- -I 2 Z 

LU<IUH- 

O^UIlN 


OCI-J 

o - ui <r 
ro o o :> 


o <r k j n 

n - Ui c o u 

OUOODOUOA 


I I 

cn cn cl cl r- 

33QQu.OAOUJ 

Clu.JJUQ.JQ.CC 


CNro©ooo©oo©o*-«cNro< 

NNooo>OHNn^m-oo«o>or 

roMroM^ww^<r^<r<r* 

nonmonioromoMioionr 


:«J <c« _j _j 

» -J OCJQ -J -J CJ U CJ A Q J J u u 0. I- _J CJ CJ U CJ 

!«CCfl:Q:2Q««JJJ2QQ<I<I2aQ > OliJ«JJJJ( 

.UnQCQC^JUUQCQCQC^^JUCJC^UQ.QCUQCQ'^IC. 


>0000»-*(NM^ , 0000000000000000000000OOOOOOO 

JC'!ro^ininininin'*OPNOO<>*o*HCNro* , in''OrNa)ch©*4CNro^in , oiN©o*©«HCMro^ 

uninmninininininininin-O'O'O'O'O'O'O'O'O'ONNNNNNNNNMDajiDfflCQ 

irororororororororororororororororororororororororororororororororororororo 


Z <1 3 O *-• 

«h-_JX CN Z rN O CL >- O 

► u <x uj a in - o >o u .cl v ► v 

ao^za a ri u o C'i lu >-h <x r-j 

UJ u. 

-J -J _j y- u. 

j j j q o. h a a r— >-3 a 
o<i<r«aoujQ.cc33UJ aa uao. 
juuu«ro.ccuno(occ a ju 

<t K 
ct: 3 

UJ l-O. 

<1 A UJ Z 

x r cd •-* r- 

U 3 UJ 

I Z * * * » CD 

oooooooooooo^(Mn<roo© 

in'ONOO-OHNIOVin'O'O'O-O'ONCDO' 

OAAAOQ<IMMMMS^(HSQ-0>Q>0>I)> 

rmemmoioioioioioioioioroioionio 


^'OfN^-rs^'fN^'TH 

wnoocvmHMM 


OM^^ONMO 

-OHinoNoon 

m wnowonn 

■ONMO'OO'ONh 

NNHIDMONNH 

rororooroorororo 


<r o *• rs 

cm rs inn 

«-< CO fO © 

in in in in © r 

HHOnin. 

ro ro ro ro o < 


o © 
© cm rs 

ro *-< ro 


CM cm n © 
rs o o >o 

CM O © CM 


ininininin > 0'0'0'0'0'0rNrsrN^nv(Noo©OT-4iH*H*HiH«HiHi-iCMCMCM 

nnnnnnnnnnnrofmnnnooooooooooooooo 

'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'orNfNiNrsrNrsrNrNrNrNrNfNrNrNrN 

rsrNrNrNrxrNrNrNrvfNrsrsrNrsrNfNrNrNrNrNr^rNrNrNrNrsfNfNrsrNrNiN 

000©©©©0©©©000©©©©©©©©©0©00©©000 


rsrNM)rNioinrNfNrs>o^rsio»n'0»H«o^^inrNrNrNrNNininin©^^'0©'0'0^ 

^ l ^^-^^HOoosro-H^-.trorNo-H-H©©ooo^--<-.oo^NrNCMrjTH 

ooMHioiooooioNHioioiiNionionooooHioioncMioiorooioioio 

2SCi5!f2 on, ' ,n,0O,H(V,,no(NM ^'0 r>s ‘^M^inMjrNCMin©^cMninfN^n^-^ 

toMronn^'v^-^-^-inininin'0'0'0>0'0'OrNrsrNrNrNrNo©»-«^»H»H^H»-iCMCMCMCM 

00000000000000000000000000*-i»-<*-s»h»h.h»-<*h»h»h»h.-s 

rNrvisrNiNiNrs.i\rN|VviNiNrsvrNrNrsrNrNrNrNrs.iNfv.rvrsrvN.rNrNrNfNrNrNrNfNrNrNrN 

rsrviNrNrv.fNrvfNrNNN.rNrvrNrvrsrNrviNr'.rNr'.fNrNrNiNr'.rNrNrsrNfNrNrNfNfNrNrs 

0©©©©00©©©00©©©0©©0©©©©©©©©0©0©©©©©0©© 


N N N N N 
fN fN rs fN PS 

© © o © o 


c l§ “-il 

01 3 c O. <« 4J J 
•C -t-i 

■U *J *. 'O +J - 

i OX* H j) ' 
I «. 4J 0) O bn 

: u c c *j -H t 


<0 T3 >Si 
j -c c 

: -u »o ts 

) -*J u $ 

i, <U Q) fn 

; 0s 42 at 
j 0) <+s *j 

j -u 3 --s Q) 

( S iJ 


» u q> 5 

tJ QJ -H 

i e n, u 

: hj 0s (o «j; 


■u T> u. a: 
h c t 

i 'Q tJ 
O, U 

ss 


A -J •> O I 

•* I ~ O - 

»-r r - z r - - u. u ~ 

0.3 3 CL 03 3 IN «■* _| 3 - a 

OCZ Z r CD Z Z INO-IA — OXT 

i- x o x o: 3 i- > ►xcxoanAvQ. j . j 

Z UJ - UJ - UJ - N UJ - UJ - - - N - A X _l U. 
w Z A Z (J « O > ZZAZ_IXCJ~<I~~X~ 


uj ro « <r 

u <r A A 

« - *4 

0. UJ - 3 N N 

cnaci-ujzuz 


Q.U. CL UJ 

r 3 o. z 

3 A *-s 

~i CL * * * _J 


OOOOOOOOOOOOOOOOOOOOOHW 
'0N0J0>owNn^in'0MD0>OHMnvin<i>0'0 
iNfNiNfNoommcDooiiicriajcDCDo*0'i>o*o*0'0*o*o* 
CM CM CM CM CM CM CM CM CM CM CM CM CM (N CM CM CN CN CM CN CN CN CN 


roooooooooooooooooooooooo«M(Nioooo«Hro*-oooooo*-4CNi*)ooooooooo*-4 

*oNO<^o»-tCNW^in'ONa>©*©^CNr»)^'in'ors.coO'0*o*0'©~«CNCNCNCNm<rm'OfNcocooooo©‘©»-»CNm<rin'OfNiN 

(MHMhOoooooooooHHHHrtHHHHHHHHNNCNr'iNNNNCNtNNCMf'iCMNCMnnnnnnnnn 

CNCNCNCNnMnnnronnwnronnnronronwmmronnromnnmnnrnrornnnnnnnnnromnnmrn 


* 0 ^- *r n <t * <r 

m *h ^ o cn in m th ^ 

*HO © H H m o o o 


in in rN in 

H rt O H 

w ro ^ n 


>o *o *o *o 
rs in in rv 
© © o © 


in in in >o o in rs 
-< in *-• rN <r ^s o 

HlOfOIOOlOH 

* c-j >o *■« n in © 

O O © H H H f'J 
CM CM CM CM CM CM CM 
"O *0 -O >0 >0 >0 >0 
rN in rs rN tN in in 
© © © © o © © 


in in o >o cm >o 

*-• ut <r rs 

ro ^ y* © © i-< 

sr in *o © ro 

rg cm cm cm ro ro 

CN CN CM CM CM CN 

*0 *0 *0 *0 *o *o 

rs in in jn rs in 

o © © © © o 


CN *4 CM 

*o >o <r <r 

© ^ © © 

^ rs o ro *o *o 

ro ro <r <r <r 

CM C J CM CM CM CM 

*0 *0 *0 >0 *0 *0 
fN IN fN IN IN rs 

© O © O o o 


in >o m *-i -h 

<r rN in >o <r 

ro o ro ro © 


NOhOO 

ro o © © in 

ro © © © cm 

>o ro >o ro in ^ 

rs CM fN cm 

o ro o ro ro ro 


© >o «-» cm o rs 

rN rs o in rN ro 

ro ro © ro ro ro 

in^'cminoincN*-* 

HCNNHnvrjOH 

roooroooororo 


ro ro o roo ro ro o o o o ro ro©ro o ro o ro ro ro roooroooororo 

'0'0©CM^-'OrNo^cMro'r'orNocMroin*oo»-tro^-'orNiNrNNCM'rininininrN^iroin©^sH^^i5rrN^^iniN©ro^- 
'rtininininin'0'0'0-0'0'0>0NNNNNoooooooooHHHHHHHri(Mf-jnnnnnnnM'<r<rviniiiyT 
r-JCMCMCMCMCMCMCMCM cm cm cj CMCMCMCMCMCMCjrororororororororororororororororororororororororororororororororo 
'O'C'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'OMJ'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O 
NfsNNNNNrLNNNNNNNNNNNNNNNINr^NNNrNNNr'NNNNNNINININrNrNNINNINNNNNN 
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO 


Number 24 

164 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 17 




2 ' ' UJ 2 Ci 

OONH u 1-1 oo 

<r u <r a 

- •• o - z> n. - o - cc a: o- 

u«o«t-tn<r«i»u uj hh 

u. 

_i _j m u. 

■J -J 2 3 

ccoccQ^coiQii a cn in 

T JTJUUJQ J1 Q Q 

»- 
3 

U. U. U. 

UJ CM 2 3 3 

2 h- uh iXi 1 X 1 

2 2 ^ 2 

<X O * * * A m 

oooooooooo*-«cmmoo 

HfJM^in'ONDBO'OOOOHN 

'O'O'O'O'O-O'O'O'Oi^rsrsfsr^rv 

'r<r<r<r^r*r<r<r<r»T<r<r<r<r’r 


'On>o^'Hin>omjTinnov' 0 'Oor)Hn©N*r<rfjvN 

OUTM'OUTinMNMNrOfJ'OfJOin'OOHNwCJNVf'IN 

h ri rj n o h ri rj f'j n o o h rj ruj n n to o h h n n n 
cm ^■<r«r<rinininuoinm' 0 ' 0 ' 0 ' 0 ' 0 ' 0 ' 0 ' 0 ' 0 r , sfsr^rsr > sr^ 

© r\r\rsrsi\Nrsrsrvrvrsf\rvrvrvrvrvr\iNrvi\i\rvrsrv. 

©oooooooo©oooooo©oooooo©oo 

t r £ 

2 *- Q O 23302U. 

OO X 32 KHU.IlU.h22 © 2 h 3 

2 <t H- UJ Q CL CM O O O 0 1333 V JQHI-t-<[tt 

O J0X2bl2HnIiijH>.22iBiSaiUJ«HUJX<02 
2U.22<IZU.>-ZlflK2>-HfllXHm25I02t<lH 

ooonoooo^MinNNfjN’OO-ON^VHn^Nir 
n n n h Mn h n r-j <o f j o in r j >o <o n o iii h rm n h in 

n o h n m o h h nn n o o h h cm cm ri n n o h h m n n 

© ^■<r<r<ruTUTioininin'0'0'0'0'0'0'0'O'0rvfvrsisrv.rs 
©rsrsrsr^rsfsNNNrsrsNrsrs.r^Nrvr , srvrsrsrvNrsr , v 
© 00©©000©0©©000000©00000©© 

UJ X OZKU) h 

W Q (J 2 23 UJHH 3 U. 

(J CC O UJ >- <X U.U.UJC 2 AUI(nQ 3 

« NOt-UK 0 . ^ in LH(J 3322 X 2 QO 20 J 
iLhZ 2 UJUlNHrtiLKHX 3 W 0 aiaHMUi 303 Hil. 

nmzuaizxzjuzxuixocQjiLZZCi-aiai 


V 'l -V 'J -v UJUJUIUJUIUlUIMJ'g'O'O'O'OSJ-OIMNMVMN 

© rsrvrvisNrsNr^rvrsr^rsrsrsf^fsisrvrsNNisrvNfv 
O 0©©©0000©0©©00©00©©©0©©0© 

a 3 CL H 

<x 2 3 <1 2 U 

O I- a 3 wIl1lU.2 0'ChCD CM 

J H 2 2OOK^IDt0UJC333UhXZHhh 

>h2UJO<T-flyHu.KHHOIOi5iS«<IXUJOX33 
HU131flUZZtnZJIiJZZLinjLNu'ifi2Z2ZOO 


o n h w o in © in 
©>o©'Orsrs in cm 
© cm o cm m m mom 

O'OO-oininHO'OM 

r^rvMr^»H*HisM©© 

OOOOMM^HOOM 

•oon^'OH«rinNH«r<r'r'rN 

rjMMMM<rccvininininiiiN 

MMMMMMMMMMMMMMM 

f\rv.rs.f\rvrsrvNr\r\r s sr\rvrxr\ 

rvrsrsrvrvrsrsrsrsr^rvrsrs.rsN 

©00000©0©00©©00 


'OO^HiniO'O^WinONHN^O^OVH-ONHINH 
uTinoiniN'Oino^roMM'OMMini^oMO'OMoo 
UNhNNMOhNNMMOOhNWNMMOOhNM 
o -H<r^-^-^‘inininininin«O' 0 ' 0 ' 0 ' 0 ' 0 ' 0 '<jr < sr^r^r'.r^ 

O ONNNNNNNNNNNNNNNNNNNNNNh 
O 0©©©00©0©000000000000©0C 


X X K O 
cn u uj cl r 

KhU.U.u.iCIIK3W 

Q(L33IUJXh03 


mwvuu U- LL -»v uj rj ILru.U.U.XLLILJU, 

2<r >u.roujino 2 n h n Qa.332u_jxi-or 
>-ac ujAKi-zini(hHa.uH>-zxiiiCD3«cLJZi- 
tnuj ^Ni(n«z(flziLJozxH#>-i-)a^zHmii 




<rin»-iOfsrsMMr^^orv 

MhCIhOhOh^Oh^ 

hCMOMOMOMCMCMMCM 


cm n cm rs in 
0 rs rs cm 
© M M O M 


in'OOMninw 
hMTNhNh 
M M O M M M M 


in'OO'OO-OOMCMM'O^H'OO-Oin'OM 

HNWMiTMi-JO'OONVMnNHOO 

MMOMOMOMOMOOCMOOMOM 

imfiNHMinNH^Nfj^NONVNH- 


<r <r -o in in 

o © rs CM 

Oh O M 

W in N in >0 M 
»h m m ^ 0 0 

M M uj M O M 


*r <r ^ 
’H CM -H uH 

O *-* O o 


M li") CM ■uj 
in © OO 

CM O © 


<o >o cm in 

O OMM 

’H O M 


m v •<) o o <j <h m in <0 n h m tkj n iii n h m iiT i\ u «r n n n 0 n v n h <r v »r <r n h n n nh n cn n m 
MMMMMM< r<r^^'<TiniiTiiTiniiTinin'0'0'0'0r v srvr s soo©’-i^H’-<»-<C'jr‘'jr'irjCMrjMMMM^'<r^r , T<T 

r r r r r r ^ r r r r r r r r H r H H H rt H h n n n n n rKKKj ri n r * rj r * 01 ^ ri ^ 

rsrsisrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsfsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrs 

rsrsfsfsrsisrsrsrsrsrsfsrsrsrsrsrsfsfsrsrsrsKrsrsrsrsrsfsrsrsrsfsrsrsrsrsrsrsisrsrsrsrsrsrsrs 

©©©0©00©0000000000000000©©©©00©00©00000©©00©000 

Page 18 I 


MnNmiTMnNMH-coMnoH^ijmin'flM 

(MHMHHOHHio-OMniiTinMHMHMHOO 

-hMjhMM*-*M-iMMMOCMM©O^M»hM©M 


in >0 N N 
-« O O ^ 
M O O »H 


•ONNM'OeiNin'ONONVinNHlMM'ONN^NNNNCNI^in 
^■vinii‘)in'0'0'0'0'0isr^r^.rsrso©©©©'»-i»Huj»H^»j(MCMCM 
CMCMCMCMCMCMCMCMCMCMCMCMCM CM MMMMMMMMMMMMMMM 
fsrsps.rsrsrsrsfsrsrsrsfsNfsrsrvrsrsrsrsrsrsrsrsrsrsp\rvrs 
rsrsrxrsrsfsrvrsisrsrsrsrsrsrsfsrsrsrsrstsrsrsrsrsrsrsrsrs 
©00©©©0000©0©00©©000©©©000©0© 


Dr. Dobb's Journal of Computer Calisthenics 81 Orthodontia, Box E, Menlo Park, CA 94025 


Number 24 




EXIT THIS REVIEWER 

Jef Raskin 

Director of Communications, 

Apple Computer Co. Received: 78 Jan 19 

1 have accepted employment with APPLE Computers, Inc. 
It is a case of putting their money where my mouth is, and 
now I will have a chance to apply my criticism from inside 
a company. Since I will be Director of Publications there you 
will know who to blame if, in a year’s time, their manuals 
aren’t up to snuff. Some other reviewer will have to judge 
if I’ve succeeded. 

This (except for a few that are in the works and may 
appear in print after this one) is my last review. I will probably 
continue to write opinion articles, but will no longer cling 
to the mantle of objectivity. At the end of this article I will 
have a few words to say about my new employer’s products. 

But on to a review. A reader called and asked me about 
Electronic System’s kits. He pointed out that the company 
looked fishy, having a Santa Clara phone number and a P.O. 
Box in Burlingame (Box 212, Burlingame, CA 94010). No 
street address is given. Burlingame is in San Mateo County. 
I told the reader that I would find out what was going on. 
I called them up, and after evading the answering service to 
talk to the real wheels, found out that the separation was due 
to their desire to keep a continuity of address for their 
customers after they had moved. Fair enough. They use a 
box rather than a street address to prevent their being ripped 
off (which apparently has happened once). They went a 
bit further and agreed to send Dr. Dobb’s a small kit for 
review. Any company brave enough to do that can’t be all bad. 

Their catalog is labeled: “Hobby Computer Kits”, but 
should be subtitled: “mostly for those with a strong electronic 
bent”. These kits are not for beginners, nor are they intended 
to be. In fact, Electronic Systems prefers to just sell boards 
for most of their kits. You can scrounge up the parts, follow 
their schematic, and modify away to your heart’s content. 
The kit I got was their RF Modulator. It’s $13.50 with built 
in power supply and regulator (to run off a 12VAC center 
tapped transformer, 8 volt unregulated supply, or it can run 
from a regulated 5 volt supply) and with the parts supplied. 
Almost. The obvious unit for comparison is the Pixieverter. 
The Pixieverter (which works fine) requires —6 volts which I 
find sometimes hard to come by in my TTL breadboarding. 
So I appreciate Electronic System’s choice of operating 
voltage. It also makes their unit a very good buy for the 
money. 

There are no “put square peg 1 into square hole 1... ” 
type instructions. Just a schematic and in this case, a slightly 
off-register but clearly silkscreened parts placement on the 
printed circuit board. Layout was clean and professional. 
I discovered that C7, a 3Pf capacitor was missing from their 
parts list in the catalog, on the package, and was missing 
from the kit too. Consistent, at least. Unfortunately, the 
schematic and the circuit do require C7. I didn’t have any 
in my parts box so I just twisted a 3/8 inch pair of solid 
insulated wires together to make a capacitor (what Hams calls 
a “gimmick”). 3 Pf isn’t much capacitance, and any two 
conductors in the same room together have some capacitance 
between them. 

You have to wind a coil yourself. There is a note telling 
you how to do this: 

COIL —3 3/4 turns of 22 AWG wire wound on a no. 2 pencil. 

I quote this exactly. If you can’t recognize a piece of 22 AWG 
wire you shouldn’t be building this kit. It just refers to the 
gauge of the wire. You also should know that this wire gauge 
is not too critical. If you get a finer gauge, the coil will be 
rather unsturdy, but will work. A little heavier wire is OK 


too. The kicker is the specification of a no. 2 pencil. Since 
the pencil does not become part of the circuit (it is just the 
form for the coil—although they doen’t say so) it is unclear 
just what difference the hardness of the lead makes. What they 
meant was to use a standard 5/16 inch thick pencil as a form 
for winding the coil. A 5/16 dowel will work. Again, this kit 
is meant for people who will automatically figure this out 
for themselves. No hint is given as to how to read the values 
of the components given with the kit. The components seem 
to be of acceptable quality. The capacitors that were supposed 
to be Silver Mica were indeed of that type. 

While I do think that Electronic Systems could be a bit 
more careful in their documentation, I believe that there is 
a place in this world for kits such as these, where one can 
substitute knowledge and experience for money. These kits are 
inexpensive, and in this reviewer’s opinion, a good value. 
Those who are not in a position to figure out sparse 
instructions will have to pay more elsewhere. Many of their 
kits seem fascinating, and there are a number that seem 
downright handy. They have a UART and baud rate generator 
kit for $35.00 (board and schematic only $12.00), a modem 
kit for $27.50, a very appealing RS-232 to and from TTL con¬ 
verter kit for $7.00, and some others. Write for their catalog. 

Electronic Systems also offers a memory board and their 
TIDMA—which is a Tape Interface Direct Memory Access 
board—which only comes assembled and tested. It sounds 
fascinating , but you will have to write to them for details. 
Their catalog contains schematics, and is quite educational 
if you know which squiggle means what. 

I promised a few words about my new employer’s 
computer. The APPLE: it is a very neatly packaged 11 pound 
computer that is unusually complete. It uses a home TV 
(preferably color) for output. It comes with built-in speaker 
and joysticks and the associated interfaces, and with a built-in 
cassette interface. The keyboard is built in as well—and it is 
a pretty good keyboard (compared to the PET it is an 
excellent keyboard). BASIC is in ROM and comes up at the 
press of (three) buttons. The APPLE is fun. But it is not, as it 
stands, too serious. You can’t (from within BASIC) store data, 
but only programs on the cassette. The screen is upper case 
only, so you can’t do text editing. The BASIC is integer only, 
so you can’t do business or most scientific applications— 
although APPLE does provide a floating point BASIC on 
cassette. It is called “APPLESOFT” as it was written by 
Microsoft which has provided so much of the personal 
computer software. Both APPLE BASICs provide color 
graphics in an easy to use form, which is one of the chief 
charms of the machine. It is probably the best computer 
around to use to teach programming in BASIC. 

The hardware is especially good, it is a very reliable 
machine, as I have learned in some 12,000 miles of traveling 
with one in its optional leatherette (i.e. plastic) carrying 
bag. The switching power supply is both light in weight and 
more than adequate, and I have had no overheating problems 
at all. You can’t even warm your hands with it in a cold 
hotel room. Unlike the PET which limits you to a measly 
8K, the APPLE II has room for 48K of RAM inside the 
little box, and upping the memory merely requires changing 
three jumper blocks and slipping the appropriate chips into the 
sea of sockets provided. An 8K APPLE costs $995 compared 
to the $795 PET, but the PET does contain its own cassette 
recorder and video display. My thoughts on the PET were 
published in the September/October (1977) issue of Personal 
Computing. The APPLE II is a lot classier. 

The existing APPLE II documentation is very poor. But 
this is what I am trying to change, as I said. I think the APPLE 
has a lot of potential, otherwise I wouldn’t have gone to work 
for the company. It’s not on the S-100 bus (it’s not 8080 or 


Number 24 

166 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 19 



8080 QUICKSORT 

by Mike Gabrielson 
P.O. Box 2692 
Stanford, CA 94305 


1 

d 

3 




* QUICKSORT 

- *1*6 

GAPWIELSO* - 12/1/77 




* ACCEPTS! 

A = ADDRESS (iF FIRST RECORD TO SORT 

5 






Hi s ADDRESS OF LAST »E10WD TO SOwT 

7 




* UUlCK 

IS A 

RECUR 

SIvE ROUT INF. . . . 

9 





PRUCEDURE QUICK (DE, hl) 

1 0 





IF DE 

>: ML 

Then WETURN 

1 1 





else 

PARTITION TP FIND K 

Id 





QUICK 

(K + l » 

HL) 

13 





QUICK 

(DE, 

K-l) 

1 m 





RE f uR 

* 


16 




* partitioning swaps data and produces an addkess k. 

1 7 




* DE < = 

K <s 

hl, SuCw That ALL DATA TO ThE LEFT OF K 

16 




* IS LESS Than ThE 

0 A1 A AT K, AND DATA TO THE WIGHT 

1* 




* IS GREATt* 

. THIS IS DE SCRIBED IN VOLUME 3 OF knjIh 

20 




* ThC ROUTINE IS CODED FOP SORTING ONE bYTE RECORDS, 

21 




* BUT 

HE SI 

x comments indicate rhat to change to sow 

2d 




• RECORDS OF 

OTHER 

LENGTHS. 

dl 








2u 

ouuo 

4 

C03200 

QUICK 

CALL 

UE_HL 


2b 

UUU3 


do 


RM 



do 

OOOM 


05 


PUSH 

WO 


21 

0005 


E5 


*>uSh 

Rh 


db 

U006 

N 

CD3POO 

LOOP 

CALL 

DE_hl 


2 9 

OOOv 

w 

DA 1F 00 


OL 

RIGHT 


30 

O00C 

N 

CJ5D0U 


CALL 

SwAP 


31 

OOOF 


13 

LEFT 

INCP 

WO 

1 - make DE POINT 

$ 2 

0010 

K 

C D 320 0 


CALL 

DE.hl 

TO NEXT RECORD 

33 

UUl 3 

ft 

CA2600 


9E 

FARTED 


3* 

Ud 1 6 

W 

CD 3800 


CALL 

OE_hl 


3b 

U 0 1 9 

N 

uAOF 00 


6 L 

LtFT 


3e 

ouic 

N 

CD3800 


CALL 

Swap 


37 

UU1F 


2H 

RIGHT 

DE CP 

RH 

2 - make HL POINT 

3b 

002u 

W 

CD320 u 


CALL 

DE_hl 

TO PREVIOUS RECORD 

39 

0U2 4 

K 

C20600 


«NE 

LOUP 


MU 

uu2b 


E3 

PARTED 

*ThL 



Ml 

U027 


1 4 


INCP 

RD 

3 - MAKE 0E POINT 

M 2 

0028 

W 

COO 00 0 


CALL 

QUICK 

TO NEXT RECORD 

m3 

0028 


tl 


POP 

NH 


UM 

002 C 


26 


UECP 

Rh 

M - MAKE HL POINT 

Mb 

U02U 


Dl 


POP 

RD 

TO PREVIOUS RECORD 

46 

002t 

R 

CD0000 


CA(.L 

QUICK 


iil 

0031 


C 9 


Rt 1 



MV 

0032 


7A 

Ct.HL 

LH 

W A , RD 

COMPARE DE TO HL 

50 

0033 


bC 


CR 

R A , w H 


51 

0 0 3m 


Cf» 


RNfc 



5 2 

00 35 


7o 


LR 

nA,RE 


53 

003b 


bO 


CR 

ra,«l 


5m 

0u 3 7 


C 9 


RE T 



55 




* 




5b 

0U3t* 


1 A 

DE__HL 

L 6 A 

hO 

5 - COpPAWE kE CURDS 

57 

0039 


bt 


C 

nA 

POTNTFD Tu bY DE# hl 

5b 

00 3* 


C9 


WE 1 



5V 




• 




60 

0U3B 


1A 

Swap 

Lb A 

wo 

6 - SWAP RECORDS 

bl 

U03C 


Mb 


Lb 

Mb 

POINTED TO ttY OE# hl 

b 2 

0030 


77 


STb 

W A 


63 

0U 3E 


7H 


LR 

H A,RH 


6M 

O03F 


12 


ST A 

WD 


65 

U 0 4 0 


C 9 


WET 



#>b 




• 




67 





EnD 




Z-80 based so it wouldn’t be anyway) and there aren’t a lot 
of accessories available for it yet. On the other hand, it comes 
with more built in than any S-100 computer, e.g. color 
graphics a la Cromemco’s dazzler, A/D to run joysticks (and 
it comes with two single axis sticks), cassette interface, BASIC 
in ROM, programmable louspeaker output, keyboard, room 
for memory expansion without buying boards, etc. So it’s a 
toss-up in that regard. I am not getting rid of my S-100 
computer. 

I expect APPLE to come out with RS-232 interface, 
upper and lower case display, floppy disk interface, and all 
the other goodies that I can put in my Poly-88 (which, dear 
fans, still runs great). 

I would like to thank the hundred or so readers who 
sent in helpful letters spurring me on to write more reivews, 
and the three or four who gave me hard, but useful criticism. 
Thanks to Jim Warren for putting up with me, and to the 
neat people at People’s Computer Company who publish 
this Journal. And a big thank you, and my admiration to 
the many manufacturers who sent us equipment for scrutiny* 
and hope that the new reviewers) get as much cooperation 
as I did. 


ELECTRIC PENCIL WORD PROCESSOR FOR 
NORTH STAR DISK 

News Release Received: 77 Dec 28 

The Electric Pencil character-oriented word processing 
software allows text to be entered and manipulated at any 
location as a continuous string of characters. Lines are format¬ 
ted automatically. Features include cursor controls, global 
search and replace functions, bi-directional scrolling, right and 
left justification, wrap around text as well as character, line 
or block insert and delete. Page formatting is at the control 
of the user. The Electric Pencil has its own DOS. Storage and 
retrieval of text is simple and automatic. Six versions are 
available for North Star including SOL-20, VDM-1 or VTI 
videos, standard printer (TTY, etc.) or Diablo HyTerm. 
Minimum system hardware for 8080 or Z-80 micro is 12K 
of memory, printer plus interface, video monitor plus VDM-1 
or VTI interface, North Star Disk and/or Tarbell or CUTS 
cassette interface and recorder. Available from local dealers 
or from Michael Shrayer; 3901 Los Feliz Blvd.; Los Angeles, 
CA 90027. 



PERCOM CIS-30+ CASSETTE 
INTERFACE TO MITS 680B 


News Release Received: 78 Jan 13 

Percom Data Company released technical memos describing 
how to use their standard CIS-30+ interfacing unit with the 
MITS 680b computer. Long used with the SWTP 6800, the 
CIS-30+ interfaces two cassette recorders and a data terminal 
to 6800-based microcomputers. 

The CIS-30+ provides user-selected cassette data rates of 
30, 60, or 120 bytes per second, and data terminal rates of 
300, 600, or 1200 baud. The two cassette interfacing circuits 
are independent and operations such as cross filing therefore 
are possible. Optional program control of recorders is available. 

Cassette data recording is KC-Standard/Bi-Phase-M 
(double frequency). The data terminal communication mode is 
full duplex. 

The MITS 680b PROM monitor may be used for loading 
and running programs, except for flipping the tape switch to 
ON for program loading. 

The CIS-30+ sells for $79.95 in kit form, and $99.95 
assembled and tested. An instruction manual is included. For 
MITS 680b applications, users should request PERCOM Tech 
Memo TM-CIS-30-09, “Using the PERCOM CIS-30+ with the 
MITS 680b Computer.” 

Optional accessories include an IC socket kit ($4.95), a 
Remote Control Kit (for program control of recorders) 
($14.95), and a test cassette with operating software ($4.95). 

Contact PERCOM Data Company, 318 Barnes, Garland, 
Texas 75042; (214) 276-1968. 


Page 20 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 24 

167 





SMAL/80 BUBBLESORT 


SMAL/80 MACRO-ASSEMBLY LANGUAGE 
FOR 8080 AND 8085 

News Release Received: 78 Feb 6 

CHROMOD Associates has announced the development of 
SMAL/80, a compiled, structured, macro-assembly language 
for 8080 and 8085 microprocessors that requires 7K of 
memory. 

SMAL/80 statements are written in a symbolic notation 
resembling PASCAL and PL/M that simplifies the writing of 
assembly language programs. SMAL/80 also incorporates the 
basic structured-programming constructs, the DO-END, 
IF-THEN-ELSE, and LOOP-REPEAT, which may be com¬ 
bined with and/or nested within each other without limit to 
form complex statements. The code produced by the compiler 
is as efficient as that written in a traditional assembly language 
by a skilled programmer. 

The SMAL/80 package includes a 2K macro preprocessor 
written in SMAL/80 that extends the usefulness of the lan¬ 
guage. The macro preprocessor permits conditional expansion 
of statements, unlimited nesting of macros, and has a natural 
notation. 

Also included in the SMAL/80 package is a translator pro¬ 
gram that allows one to convert any 8080 or 8085 program 
written in standard Intel mnemonics into SMAL/80, but with¬ 
out the constructs. 

SMAL/80 is a revision of SMAL, and 8080 language 
developed by Dr Charles Popper at Bell Labs. The original 
SMAL was implemented via a SNOBAL preprocessor running 
on an IBM 370/168. SMAL/80, also developed by Dr Popper, 
has been redesigned and can now be compiled directly on any 
8080, 8085, or Z-80 machine. 

SMAL/80 is being offered initially in CP/M and ISIS I disk 
formats. Price, including documentation, is $75. In the near 
future, a Z-80 version of SMAL/80 in the same disk formats 
will also be offered, as will various relocatable tape cassette 
formats that incorporate linking loaders. 

Write CHROMOD Associates, P.O. Box 3169, Grand Central 
Station, New York, N.Y. 10017. 


STANDARD BUBBLESORT 


SI7E: 

E0U 

255 

;max size of ARRAY 

LOOP1: 

MVI 

D,0 

;reset "switched" flaa for 




;i teration 


LDA 

N 



MOV 

B.A 

;number of list elements 


LXI 

H,ARRAY 


LOOP2: 

DCP 

B 



J7 

NEXT1 

;no more pairs left 


MOV 

A.M 

;first element of pair 


I MX 

H 



CMP 

M 



OP 

LOOP 2 



MOV 

C,M 

;do an interchange 


MOV 

M,A 



DCX 

H 



MOV 

M,C 



I NX 

H 



MVI 

D.l 

;set the "switched" flag 


JMP 

L00P2 


NEXT1: 

MOV 

A,D 



ORA 

A 



JNZ 

L00P1 



HLT 



N: 

DB 

SIZE 


ARRAY: 

DS 

SIZE 


END 





SIZE EQU 255 
LOOP; 

0 = 0 /* reset 

A = M(N); 

B = A 

HL = ARRAY; 

LOOP; 

IF —B ZERO 
BREAK; 

A = M(HL) 

++HL; 

IF A : M(HL) NEG 
THEN DO 

C = M(HL); 

M(HL) = A; 

-HL; 

M(HL) = C; 

++HL; 

D = 1 
END; 

REPEAT; 

REPEAT WHILE [A = D; A = A 

N: BYTE SIZE; 

ARRAY: RESERVE SIZE; 

END PROGRAM; 


/* max size of ARRAY */> 

"switched" flag for this loop 
iteration */; 

/* number of list elements */; 

/* if no more pairs left */ 
/* first element of pair */; 

/* an interchange */; 

/* set the "switched" flag */; 
A] NOT ZERO; 



ADAPTER DOUBLES DECWRITER SPEED 


News Release Received: 78 Jan 23 

The Larks Accellewriter™ adapts any LA36 DECwriter to 
operate at 600 baud. The adapter converts the standard 110/ 
150/300 baud DECwriter to 110/300/600 baud. It changes the 
internal timing of the DECwriter and causes it to print at 60 
characters-per-second. Installation typically takes less than 
one hour and requires the removal of two integrated circuits 
from the logic board of the DECwriter. These are replaced 
with low-profile IC sockets. The Accelewriter is then installed 
in the board in place of the two original IC’s, and the logic 
board is reinstalled in the DECwriter. 

The DECwriter can be reconverted to its original electronic 
configuration by unplugging the adapter and installing IC’s of 
the original types in the sockets. This takes less than one 
minute and requires no tools. The Accelewriter causes no per¬ 
manent modifications to the DECwriter and does not interfere 
with the installation of standard DEC™ option boards. Price 
is $95 and delivery is from two to four weeks. Installation is 
available in selected areas. Contact Larks Electronics and Data, 
Box 22, Skokie, IL 60077; (302) 677-6080. 


Number 24 Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 

168 


Page 21 



A Line-Oriented PILOT Editor 


BY DAVID J. MORGAN 

University of Texas at Dallas 
P.0. Box 688 
Richardson, TX 75080 

Dear DDJ: 

I have written a line oriented editor for Dr. Starkweather’s 
PILOT ('DDJ, April, May, 1977). My program takes an 
additional 629 bytes of memory and provides nine editor com¬ 
mands. 

The attached program listing shows the assembled output 
and assumes that the PILOT source program (as shown in the 
May, 1977 DDJ,/ has been assembled with it. User documen¬ 
tation, in the format of the April, 1977 DDJ PILOT documen¬ 
tation, describes the operation of the editor. Thus, the routine 
can be implemented by assembling my code at the end of 
Starkweather’s and filing the documentation in place. 

Interfacing to PILOT is easy due to the modularity and 
well planned design of the original program. The steps are 
as follows: 

1. Since we are extending PILOT we must change PBUFB 
which indicates where the user program area starts. 
Change the following line (originally the sixth line of the 
program on p. 18 of DDJ, May, 1977): 

PBUFB EQU 1000H 
to: PBUFB EQU 11A7H 

2. Change the JMP in the vectors (so that when the user 
enters edit mode the machine does not jump to the 
monitor) from: 

0112 C360E0 EDIT: JMP MNTR 

to: 0112 C3EA0E EDIT: JMP EDTR 

3. Similarly, change the following: 

0309 C360E0 JMP MNTR 

to: 0309 C3EA0E JMP EDTR 

My routines call Starkweather’s I/O (DSPLY, CHI, KEYIN, 
CHO) and his block transfer routine (BLKTFR). I also pickup 
the EBUFF address (the entry buffer address) and PBUFE 
(End of user program area) as set by the programmer (p. 18, 
DDJ, May, 1977, 7th line). Any alterations made to any of 
these routines or addresses should be transparent to my 
program. That is, it should run anyway. 

I also have implemented the PILOT command LOAD: for 
loading a PILOT program from an iCOM disk (and construct¬ 
ed with iCOM BUILD or EDIT commands) running with 
FDOS-II and a TIME: command for use with a Comptek (now 
Canada) CL2400 real time clock. I’ll be glad to send these 
routines to anyone who wants a copy. I’ll also send the editor 
routine on a diskette if you send me one to write on (iCOM 
compatible) but I guess I can’t include all of PILOT on disk 
because of the copyright. 

Sincerely, 

David J. Morgan 
Assistant Professor 

P.S. Please mention that Binary Systems, Inc. of Richardson, 
Texas (The Micro Store) was good enough to let me use their 
machine and a new ribbon to produce a hardcopy output. 
They are pretty good people. 


After invoking the PILOT EDIT: command the system will 
respond: 

PILOT EDITOR READY 

If there is no current user program in memory the system will 
then display: 

PGM SPACE EMPTY -ENTERT OR ‘E’ 
indicating that the user must either insert text or exit from the 
editor. The system will then prompt the user with an asterisk 
(*). After the prompt is displayed, any of the following editor 
commands may be entered. 

B Backup the line pointer. This routine backs up the inter¬ 
nal pointer to the previous line of text and then displays 
that line. The previous line of text is then made the 
current line. If this command is invoked when the 
current line is the first line of the program (and hence no 
backup is allowed) the message: 

-START OF FILE - 

is displayed and the current line is left at the first line of 
the program. 

C Display the “current” line of text. When the editor is 
entered from PILOT and a program is in memory, the 
current line is automatically set to the first line of the 
program. 

D Delete the current line of text. The current line is re¬ 
moved from the program and all following lines are 
moved up. If there are no lines left to delete, the 
message: 

PGM SPACE EMPTY-ENTER ‘I’ OR ‘E’ 
is displayed indicating that a program line must be 
entered or the user must exit the editor function. 

If the delete is allowed, the next sequential line 
becomes the current line unless there are no more lines 
in the file. If no more lines exist in the file the last line 
(before the deletes started) is made the current line. 

E End of editing. Returns to PILOT mainline. 

I Insert a new line of text. After this command is entered 
the editor will respond with an equal sign prompt ( = ). 
The user may then enter a new program line. The new 
line will be terminated by a carriage return. 

The insertion is made immediately after the current 
line and the new line, once entered, becomes the current 
line. If there is no space available to insert the line the 
following appears: 

- PROGRAM SPACE FULL- 
The insert will not take place but no other action will be 
taken and the editor will prompt for a new command. 

N Display the next fine of text. The routine advances the 
internal pointer to the next line of text and then dis¬ 
plays that line. The next line is then the current line. 
The search for end of line is always to the carriage return 
character (0D hex). If there are no more lines in the pro¬ 
gram to display, the message 

-END OF PROGRAM - 

appears and the current line is left at the last line of the 
program. 


Page 22 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 24 

169 





P Prints the entire program on the console device. This 
routine will print the entire program exactly as a regular 
PILOT command of DP: would. 

R Reset the line pointer to the beginning of the program. 
The first line of the program in memory becomes the 
current line. 

Z Reset the line pointer to the end (last line) of the pro¬ 
gram. The last line in the user program is made the 
current line. 

NOTES: It is imperative that all programs end with a carriage 
return and a ctl/a (01 hex) character for the proper operation 
of the editor. When entering programs in PILOT this will auto¬ 
matically happen if the terminator character (ctl/z) is not 
typed until the last program line is ended with a carriage 
return. If you are entering programs in the editor, it will auto¬ 
matically take care of this operation. 



16K RAM BY NORTH STAR 

News Release Received: 77 Dec 20 

North Star Computers, Inc, announces a new, 16K RAM 
board for S-100 bus computer systems. 

North Star’s 16K RAM is designed for use in both 8080 and 
Z-80 computer systems. It will operate at full speed (zero wait 
states) even at 4MHZ. 

The low-power board uses 200 ns dynamic RAM chips and 
the on-board memory refresh is invisible to the processor. 
Bank switching capability is provided and the addressing of 
the board is switch-selectable in two 8K sections. 

Another feature of the board is the availability of a parity 
check option. The North Star 16K RAM board is offered in 
kit form at $299 and fully assembled at $459. The parity 
option costs $38 in kit and $59 assembled. For further 
information, contact: North Star Computers, inc, 2547 Ninth 
St, Berkeley, CA 94710, (415) 549-0858. 


s 


m 


x t- 


>- cj i 


i z <r i 


CL CC -- 

•- l- O U -C 

LL J U <X 

r <x x 

a ZUIUlHh I— LUh u c 

lu h3doi/i >■ inazo 
io_i« a. ® a: hh z <x o 
o om wo o o <t x 

i h r uj h w i- h u. z x w uj 

j io « in Ht-ouia: 

J H H H Z H ouuio 

IO 2 Z <XZUJZ U X O U x 

atS H H I- H hllJH ho 

Ch OCtUJ 0<XOUJXOOUJi20 
- --H 0.Q.U) 0. W Cl O U ^ O O il m 

T .► .* .» ... .. .. .. <. .. .. .► 


O W Z »H CJ 


! X h u a; I 

: o cc o i 

: a w o o > 

j w w H 

3 <X UI W Z CL 
UUIhOC 
1 H O * UJ 

Ui CC « O 

a cl r o uj 


r >- h o h o 

cu _j uiima 

uju.hZu.zo. x x 

- W •- >-< 

i Ci i j i j i <r o 


I* O H H 
ClUmG 

x o uj ui 


«■ o 


j x x u h r 

.OOhZhO 
) (J U ‘HdO. 
i O O I J UJ ' 


UJ UJ oc z z> 
►H o O 

CC H CC u. <x 

O o H H 

U. X U. _J W CC 


h oc H 
(J « W 
UJ UJ 
Cl -I O 

iouo 


U I CJ 
UJ Cl UJ 
I Z I 
CJ UJ CJ 


z z cc a 

►1 <x z 

x 

o cc a z <r r 
zuizour 

<Z K <X U I O 

z r au 

X UJ X CC UJ 
O I O O UI0C 
(J H CJ H U.O 
►H H 
CC X UJ Q UJh 

o o x uj za 

U. CC H HHUJ 
U. UJ -J 

Z H O h- 
c n uj «x ouj 
c o co au 


o >- x x 

0-1 O LlO 

OC CL W u _JU 

- CD X Ci CC Ci 

I Cl U UI OUJ 


X <x 
<r cc 
cc o 

O O l 

o cc : 
cc a. ► 


CC ' CC - X ' O' CC ' 
JuClOZUIACOJm 
UI' O' Z ' O' O' 


CO 

t— JC V 

UI 1-0 -J 

in ' (O' cnui cl 

* Z OC UJ N C *• CO 

HH ' CC - -IXO 


H JHJH 

x<xxxxxxoa. 

> JO J(0 JCDJXO 


J JO. 

n <x <r x 

-> O O 1 • 


hh _J _J _J —I Cl 

X<X<t«XXXOi 
• jooojana 


Cl — — — 


I-H Cl O. 

CL N CL N O X 
OT070.1- 


hjj<[ _i<r h 

X <t <r H <EO UJ 
• J OO to OJ cc . 


rH Q O H-l »H »-l U.U.U.UJ 

-H o O -I -I -I oooo 

0> ON HH UIM'OO 

n v o in <i in <i o oin -o u. 

h o h n h n h ui u <r o o m 

NONNNNNNU. OOOO 


<XQOM'00>OU.O 
UJUJU.U.U.U.U. U.O 
UJ UI UJ UI UI UI UI UJ U. 

ooooooooo 


r-j in id o 
oooo 
u. u. u. u. 
oooo 


omoovou-in 
n <r v cm in 'O <r <r 
u.ouu.OHUjQHin».uooo 
oooooHO«»<rn»rjN-o 
niM'iinHNONoo^npioo 
ritn voiniL«io(Mir)«n'ON 
HQooHfinomnoonO'fioo 
rjooo(NCNomin<rincN«r«-in'0O 

ujh» NcoooNau.nMiiu.nv 
OHHHHrtriMrutNi*)nnn<r<r 
LU.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U. 

ooooooooooooooooo 


lit N C O Ll O 


—' O Q HOH 

Hi O O O ^ 

O O' UJ U. * u. 

CO VO u v 

HQorto« o- 
NOO noM o 

m -o O' o u. cn m 
in in in m in >o o 
U. U.U. U.U. u. u 
o o o o o o o 


-I O O O U. U Ll U. t-1-hO 
^O-^hhOOOOhh^O 
in < o c uj * m m in co v u. o> o n « « uj uj a- 
cninb vavui vcv cvuinoinwoov 
ui<xuj<xuj<xuj<tuj<xuj<xuj<xuj<iw <r - o o- 

U.OUOLlOU.OIlOUOLlOU.OU.OMOO 

'Ooooooriinrscou.H^V'OO'iXiUJOfO'OO' 
O^O'ONNNNNNNOOmCDCOIXIOOO'O-O'O' 
U.I 1 .U.U.U.U.U.U.U.I 1 .U.U.U.U.U.U.U. Ll U IlLl 
OOOOOOOOOOOOOOOOOOOOO 


Number 24 

170 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 23 














3 H 
3 3 
Z x 


V u 
1 UJ 
z l 
o u 


CL X UJ OC 


H A < 

3 z : 

O UJ L 


iC UJ fi A 
A it Z Z 
A UJ UJ O UJ 

c x c 

►— H 3 4— 

4- « li. ZUJ 

UJ A 

UJaun-U.Ai£ 

1 W >- h Z iX Z 
: <r z z a uj 3 h 
j in h w Z u 

uj u UJ UJ 
■ AhK>UJ>l-> 

JZ3UJ<TI<TUJ<E 

) < u. Q U1 U Ifl Q (/) 


O (fi 
K 0C 
H 
A Cl 

a 

<x z 
u 
U. M 


AO 

zcn 

UJ UJ 


z UJ 

O 4- 

Q >- 


O 3 ~ CL 

z <r 3 o 
Z O X 
X h Z 


o 

cn 

>- >- r > 

c c in . 

Z UJ z o 

o ► o - 

H« JHI 


m A Z UJ 


OC A 
A A 
A <1 


4— 3 h ^ 3 3 K 

uj uj 3 <r o «i uj uj 

(3 (fits in AW 2 0 


z z 4- o z z 


: uj a z uj uj 

I 3 K U 3 I- 3 

i o uj uj w <r uj <r 

. I I O 2 (J) O W 


ii UJ IT h C zr C X 

(fi CL O - - 3 - - UJ 

AHUJCt h u u x u 


4- I- h Zh X 

in cn c cn u *-< z <r r 

z ^z-z- u - UJ 

h I A A O h r HtuiuUI- 


X Q£ 4- 
3 U- C 4- 
® K A U 
3 Z 0- Z 


U X W 

z z r z 

H H UJ H 

3 X 3 4- 3 


W 4- X 

ZiCOL 
0U30U.U 
H 4- O X C 
> U Z A 
4— A Z (Z 
Z Z U 3 Z 

HhUUJhUI- 
O UJ M I 3 H 3 
a. cd z u iz z o 


Cl T. XL 
- - 3 

X C X O L 


CO A 

C 

3 X 

Ll O 

r a 
to z 

CL UJ 


UJ C X 4- H h 

z i- a 

a uj ce in >-> 

UJ X Z Z O UJ iZh 

x c h o x a o ► 


CJ) UJ A 
K I- A 3 3 C 
UJ UJ Z J <T O 

CO CO <1 Cl (Si J 


4 3h 3 

o o uj <r 

Jttncn 


' z x 
ii h c 

- o >- z 

- X UJ X - - 

uuzuacux 


c a. 


X IZ 
3 X 
ill-rt 

Ul z o 


M rj h pi 


_J A ID A A ID X AO 3 

N30.UH_JCL3H3X33il.33I X X C h 30.3 <1 3 3 I H _| 

zoxzxcxi3ouxoxoxunuuao.no XO AOXUXC 
3XU33U33XXX3XUX3X3AA3U3X 3Z**. 3X3X3 U 


A AAA 
3X333H 
X Z X X X 3 
- 3 H Ul 3 UJ o: • 


H3XHNXI- 

x o z a. z u uj 

- 3 X H U -) A iZ • 


h_jjcAiZ3hIh_jhCI— 

3CCA3ZOXUXC3HUJA 

-XUU3OHX3X3UXU10:A 


ro n O' 

CM AAPH 
U N A A CM 

N C A U X 
P4 Cl CM CJ P-4 
O O O O O 


00 A O' V O' ■ 


V N A < 
A n C L 
u u cm r 

ri in ao 
hmm 
o o o 


A A UJ 
m nn 
o o o 


o in *■ 

■ • j c n n h 

bU N U N 

ibPjn«iniiiD>uAijjii'H v inco 
nfl-^-vwwTT^inin in in 
ooooooooooooo oo 


H u 
o o 

A *■ 

o- m 


O' U A O h ^ 

inin moo >o 
o o o o o o 


4 S3 O 

) a in 

4CP4D- 
J CM P4 U 


N C A l 
-O S3 -O ' 

o o o < 


C ON 
h UJ 4*3 UJ P-4 A O' 
P-4 N P 4 X O P 4 U 

in cd 0 * c u x o 

N N N N N N 00 

O O O O O O O 


A U 

O © 

a *r in 
ro«o 

UJ A A 
O U U 


x 0 - x z li¬ 
en uj uj u o 

o u h u ui 

CMHOOU 

ii") t ui p-4 <r 

h h u o r-4 n in u a 

H O O m W W V + o 

N AO-h A N O 40 in A 

•« c O' in o p- 4 n c- in re 

couu.Hja^aujpJO'Au.AH'OA 
no'nTPJuiPJUMHuriw^^pj 

JO'UAUJU.PJn-OO'AUAHinO'AH^-'OOOO' 
immmpn(nfv.iviv.r>.iVft.ft.«T<T/T .ti » .r. ,r. iTi 


l- 

l 


XH 

O H 

LL X 


3X0 
0 3 0 
X H H 


3 in 

C 3 

in x 


X 3 
3 

Z 

o o 

z 

H 3 

X X 


3 C (XI X 

X 3 3 0 

X X A X h 


3 X U 4 
O U < 
Ul- Z 


h z cn 4 - c (f) 


Z U Z H 3300 U C 4- 1- X 
O I- h >- 3 4- X H in 

X HZ 3AU.3U.OH3Z3X 30 
<D 033 O hOOOh^WUIX'i- 

x a cn x i—i—3 3 x UH3 3 
C» X XC 33- HXCZCZXH 
331— - 3 3X3031- - 3OA30J3A>- 

IXOOU ZHHXCn0003 O 3 X A A 

hczw zen zuxhc 

h- K H 3 - 3 Ah 111 H 

U.X3 33300XXZ3X 3 

h h CD OOAZZhhCXH O 


3 U 
C h 

cn z 


A A 
Z A 
3 C 


X 3 3 X 

C I- X Z 3 

H > X 3 U Z 

cn a h c 

Z A 3 

H H 3 U 3 

333HOC 

co o cn z o cn 


H 3 
I X X 
J X z 


3 C X A - 


3 X L 
o o 
U X c 


A A CZ C3U3: 

©czoxoHcn c 

C H A 3 O 

HH HAAAZ3HK 

33 O 3 3 A Z h C L 

coco cococnccxcncnc 


X 3 

1 3 Z X i 

: u c i- x i 

J X X A < 

JO z >- o 

H o x O X I- C 

: 3 h o >• o y 

■ Z H X 3 X A 

4 H H OC A3 2 

13 O A X Z C 

A I- Z I- U C 
J 3 A C 3 O X 3 C 

i 3 C U Z O X 

z h cn u c 


I- 3 H 

u a cn 

H 2 X Z 

X 3 X 3 


J C Z 4— X 


3COXZC3ZU3 


3 3X3 U U A 3 

3 3 3 X Z ZCXX 

H H A H HH H Z *—* — 

• ZUZXZA3X3A ZC A X A - 


Z X I h 

h - A > 

3 C O I i 


Cl h C 
H ' O > X 
X - X 3 X 
Z U U Z U A < 


Z 3 X 3 Z C O 
CJ X 3 O U - - 
U 3 U Z U 3 A C 


A CO A 
h 3 X hji- 
X X U X X 3 

- 3 cn x 3 cn x • 


X A A 3 X 

___I3HNXNCXC3X33X3CXXHN4- 

XOOXZZXZOXUCOXZXZI-XI-XUXCXOHZZXZL 
3XXU3HU3X3XU I U 1 U T im W 3 A Ul U T X W h h u 1 ii 


3 3HXN31- 
X O X Z Z X 3 

- 3 x u h -j cn x • 


3H_|_JCAXC33 I C 3 h A 
C3CCA3ZI-CX I AOOC 
>uxgu3H)Hinucn'*3XXA 


3 H D X 
X X O X U 
cn 3 X U 3 


© H 
© H 

H PI 
o in 

H Cl A 
P 4 PJ 3 


rs o 
c in 

-• P-4 O' 

P-4 P-4 U 


00 A 3 

c c c 

XXX 
O © © 


J X U P-4 U A P-4 X C A A l 


J P-4 O- P-4 P-4 fO P-4 C A P4 A M 3 P-4 t*) n 3 P-4 O' 


P4no-AUMAUO-p-4 30N3UAUtOUHpjp-4CMUUNHp-4HXUU 

i^inoNC 


© A H S3 

in o x a 

C 3 3 PI P-4 P-4 O' 

P-4 Mi PI U P-4 U 

3 H PI T in CD A 

3 X X X X X X 

X X X X X X X 

© © © O O O © 


O O © 


X A U H 
© O O © 

3 A <r n <r coino- 

3r)C<K ANA 

A 3 A A C O U P-4 A P-4 

uouumo'foroup-i 

UXh^-NCAUXCM 

XXOOOOOOOh 

XX0©00©©00 


in co O' a 


UXPIMT 

h h n ci ci 

o © © © © 


Page 24 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 24 


171 
















TSC 6800 TEXT PROCESSOR 


iZ Z 
<r 3 

t- o 
W u 


z z 
u u 

<x HH 
A Z 


_l CD Ci 
JXI Jh 

<iuuiuu)iocna 

UuXUlCCuuuu 


r t-htn 
O CO U X 
UZZli. 
a hh o 


5 


i d 
a m 
o a. . 


w-ou-a ucmau. u. h no- cj in © a a 

H H H H V V V -9 H H I n V <T H H IN H o 

~ — nu.nnaU'OO? unu.mo <r -« o h a h 

~ — *r v in * o ci in c i in h h h n- o n t n n t t 

Ui CM QOOCMQW^rsO'QO'OM’CMO'-HC-OM-O'U.LJ 

— in ci cunm ci ci*rv*ro*ciinininociinvirir* 

a ai tn ciO' anONaiijtfiujncNOno.OHaaujo.n'm.HQ w 

uh u ecu fcMMTfcnT»»mirti()»fcTPirc»»T»»o o 

'Oo-<iMUJU.ocMM'CDOovfMoiii.nrvO'Q'-iinthoujC'j'0«iijrc‘OrMiso 

HHH-HHHinininini0'0'O.O'0'0NrsMNa>iDa)(Xia>0.0'0'0'<E«<l<lo 


News Release Received: 77 Dec 15 

Technical Systems Consultants, Inc. is pleased to announce 
the availability of the TSC Text Processing System. This pro¬ 
gram allows the use of over 50 special text formatting com¬ 
mands. The commands included will support multiple spacing, 
left margin control, indenting, the ability to save contiguous 
space, save contiguous text, paging, right hand justification, 
left hand justification, left and right justification, centering, 
no-fill modes, page numbering, the printing of left hand, 
right hand, or centered titles, and line length control. 

Also included are capabilities for macro definition to define 
and build special formatting commands, number registers 
which can be used like variables in a program, conditional com¬ 
mand execution, setable macro execution points (to execute a 
macro at a pre-defined line number), text diversion for later 
use (such as footnote processing), the ability to prompt a 
terminal for text during the formatting process, and a feature 
which allows sending informative strings to the terminal. 

The TSC Text Processor will also output numbers in either 
Arabic, capital Roman numerals, or small Romal numerals. 
Tab columns may be defined as well as the tab character and 
the tab fill character. Environment switching is permitted for 
easy parameter changing and a loop command is available for 
repeated formatting jobs such as form letters. 

TSC recommends the TSC Text Editing System to be used 
in conjunction with the processor. These two packages will 
give the user all the powers of the most complete word proces¬ 
sing system. As with all TSC software, the complete commented 
assembler language source listing is provided as well as a very 
extensive user’s manual which includes an “Introduction to 
Text Processing”. Price of the SL68-29 Manual and Source 
Listing is $32, with cassette $38, and $40 with paper tape. 
Contact Technical Systems Consultants, Box 2574, 
W Lafayette, IN 47906. 


-J Z 
O 
H 

z u. 


iZ UJ 
=3 Z 
U HH 


J H >- Z O X 


UZUJ Ui o z 
f-KKUJOiZKZ hh 

Uu:uiXMOuj<xo4r 

CD<XCDUZXCDXCDQ. 


z 3 k o a 

H « CC UJ HZ 

o cn CL CD z « 


t- UJ h- I- O 

O O A <3 O <1 

cc z a: cl z x z 

) UJ O HH l-U 

) N U. N li. <X 

HH 3 HH CD A ► 

u. o cn cn i 

: hh z _j h z x i- c 

: o hh o 

J Ui H t- Z t: 

j ui OUJ 1 L occ c : 
j cn cd to hh a u. u h 


Z D 
3 <X Z 

o cn a 


z z z 

U <X H H 

HH UI iZ 

z cd a. 


0C U. I- z 

*- <t o o 

Z I z o z 

UJ CJ iZ H- HH 

iZ IZUli. c 

cc cc «x hh a. cd 

3 0 XU. 3 <X 

U U HH 2 

li. Z O Z UI 

h- HH u H UJ 0 3 
UJZHUJlUO<X<X 
cDcnztocncDAcn 


cc cc 
: cc «x 

< 3 X 
u u 


H- 3 y 
UI C L 

cd cn c 


UJ iZ 

i— Cl. 

Z A 

iZ I- 3 Z UlO iZ 

U O O UI iZ H A 

Z U O A 

CC CC X z <x 

CC O U UI o u 

H-u.HHiuui<ctn 

a. ►— xa « 

z z z o 
u.uozucnzui 

X UJ O UJ 0 3 

3IOhhXOhh<I 
AOCDZOAZtn 


Z H h- - A 


N U. > 
H- 0_l 

x uj a. 


l-<XI—>-K 

cc a cn j o 

XilZiZ 


_l cn C O I Z <E -H 2 I o z JQJXJ 


H -H H cn V h I- 

o z z x j cc cn 

z o _i o cn a. z i 

hh c h <r h cn u i 

_ICXA«-^AXAA' 


K iZ > 
O A J 
ZCii 

hh z cn 

X -J A A 


cn >- 
x -I 

CC Cl. 


cn a cn 

Z X X <z z 

HH - A Z HH 

_JXX<XOAX_J 


z x x cn i in z 

HH - AC •! HH 

JCIOJAO JX _J 


A _l A A 
JJJXJh 

x <r x z i uj 
cn o _j hh cn iz • 


JAllN3hhNhhJll 

X3XZOu.ZX<tXA 

-_JCnU3X03_l03A 


X J J Jh 
UXCCliJ 
AinuuiZ- 


HH J li. h 

x <r o uj 

‘ _j o u. iZ * 


-JXX3hhNX_I»- 

XOOOllZZIUJ 

H_lAAX03HHcnZ> 


A CD A A 

JI J3XHNXHNX _J 
XOXOZiZZZClZOI 
•_IX_IXHHU3HHU3Acn 


A 


cn 


A 


O A O A in * UJ 
uj uj n n uj uj n h a n 
hU.CNUrsU.UNUU 

uu.HmO'OoabiH 

AAUUUUUUUA 

oooooooooo 


HAH 
•H O -H 

O 0> N 


N- IS <C A UJ 

A A A A A UJ 
O O O O O O 


<T O -O A 
W N <T N 

~H -H HO A HM Oin HHfl 

*h h-h HHOHinnrjv h h o 

N A h ACMMOAfl-OUA N UI D> 

in o oou.tH(Nin?<ro m h? 

C is u r-J A UI N A I*) A *HU-&'AANAA0' 
no' a umi. un u un v <t t n r j nuuu 

Nin'0IS«AAOW«00'A-Hina>AUU.Nin 

UJUU 1 UJUUJUJU.U.U.U.U.OOOOOOHH 

OOOOOOOOOOOO-l'H-H^’HTHrH-H 


*H A 

o 
rs O' 


ui o n in 

CAAUJiurinriff. 
N N N IS li. U N N U 


in iii o n o n in 

<C A 4 UJ m UJ PI IO UJ f I A n 

N UJ M N n U. O H U. U N N 


Number 24 

172 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 25 














NEW GRAPHICS BOARD FOR SOL 


News Release Received: 77 Nov 15 

KEA Micro Design of Toronto has annouced the availability 
of GraphicAdd, a piggyback board for use in SOL computers 
and VDM -1 Video Display Modules. GraphicAdd gives graphics 
capability to these units (128H by 48V) and includes a SOL 
ready-to-load software package. 

Tlie GraphicAdd board mounts directly on the VDM and 
SOL main boards. It works by replacing half of the inverse 
video character set by bit-mapped graphic cells. Thus alpha- 
numerics and graphics can be mixed on the same line. Mode 
control options include fixed graphics, switch-selectable 
graphics, or programmable graphics mode. 

The software package contains a Graphics Driver, BASIC 
Links, LIFE, and demonstration programs. The Graphics 
Driver maps screen memory locations to H and V coordinates 
with subroutines to designate black or white cells. BASIC 
Links provide parameter passing to permit X, Y plotting 
directly from BASIC. 

GraphicAdd comes in kit form with all parts including 
sockets and IC’s. Fully documented hardware and software 
manuals (with all source listings) are included. Introductory 
price for the GraphicAdd kit is $50. It is available from SOL 
dealers or directly from Micro-Ware Limited, 27 Firstbrooke 
Rd., Toronto, Ont., Canada, M4E 2L2.. 



DALLAS MICROCOMPUTER EXPOSITION 

News Release Received: 78 Feb 22 

The International Microcomputer Exposition will be held in 
the Dallas, Texas Convention Center Sept. 29 through Oct. 1. 
Co-sponsored by several groups, including the American 
Association of Microprocessors, the Exposition will be 
directed toward all levels of technology from the professional 
engineer to the beginning computer hobbyist. In addition to 
the seminars, a panel of experts will be available to answer 
questions. Advance registrations indicate attendance in excess 
of 15,000 to view some 250 exhibits. Further information is 
available from Beverly Tanner;(214) 271-9311. 



EPA’s LOW COST MINIPRINTER 

news release Received: 78 Jan 3 

San Diego—Electronic Product Associates, Inc. announces 
the availability of the MP-44 MINIPRINTER. It is a simple 
and inexpensive 5x7 dot matrix printer for microcomputer 
systems. Electrosensitive paper is used to make copies at 
speeds up to 88 characters per second with 44 characters per 
line. Software control allows expansion of character size for 
emphasis. Black characters are printed on aluminized paper 6 
centimeters (2 3/8 inches) wide. 

An enclosure 4 l /i by 8 3/4 inches houses the printer and 
paper supply mounted on an interface board with all neces¬ 
sary components for connection to any microcomputer with 
TTL logic levels. The microcomputer controls the motor 
and print electrodes by an eight bit parallel output word, 
and senses timing signals on two input lines. A power supply 
of 40 volts dc at one amp must be provided to the interface 
board. 

Low cost is achieved by using the microcomputer for 
software control of all writing and timing functions. The soft¬ 
ware is explained in a stmctured form which can be easily 
implemented in any computer language, and examples of 
complete assembly language coding are provided for micro¬ 
computers using the 6800 and the 8080 microprocessors. 
Coding for the 6800 allows the printer to be operated imme¬ 
diately from the EPA Micro-68 I/O bus. Cost of this MP-44 
MINIPRINTER is $257.00 and is available from stock. For 
additional information please contact: EPA, 1157 Vega Street, 
San Diego, CA 92110 (714) 276 -8911. 


MUG MEETING IN SAN FRANCISCO 

News Release Received: 78 Feb 23 

MUMPS Users’ Group (MUG), San Francisco, California, 
June 7-9, 1978 Jack Tar Hotel. Conference includes all-day 
tutorials on programming in MUMPS, ambulatory care informa¬ 
tion systems, and technical aspects of ANSI-Stanford MUMPS. 
Formal presentations of medical and non-medical application; 
panel and discussions on applications on computers in medi¬ 
cine. Conference is the same week as NCC in Anaheim, Calif¬ 
ornia. Information: Ms. Pat Zimmerman, Department of 
Biometry, Weam Research Building, University Hospitals, 
Cleveland, Ohio 44106. 


Page 26 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 24 

173 













In the last issue of Dr. Dobb’s we published the documentation and PL/M source listing 
for the ACT 8080 Macroprocessor by Alex Cecil of Lawrence Livermore Laboratory. 
Here now is the symbol table and the assembler listing. The table preceding the assembler 
listing references selected line numbers in the PL/M version to the assembler listing. -TRW 


BY ALEX CECIL 

Lawrence Livermore Laboratory 


An 8080 Macroprocessor 


S00986 

18 

S00806 

PFRN 

S00984 

5E 

S00805 

12 

S00983 

17 

S00803 

RECORDNO 

S00981 

25 

S00802 

SETFILERECORD 

S00979 

PRESETDRIVES 

S00800 

8 

S00974 

PRESETATIN 

S00796 

» • t 

S00973 

CH 

S00791 

DRIVE 

S00903 

7473 

S00790 

CH 

S00902 

7366 

S00789 

I 

S00901 

7A7A 

S00787 

FILENAMEPTR 

S00900 

7372 

S00786 

SETFILENAME 

S00899 

6C63 

S00785 

' 1 ' 

S00898 

6E76 

S00784 

'3' 

S00897 

7766 

S00782 

PFVN 

S00896 

6674 

S00780 

PFFS 

S00895 

6E74 

S00777 

N 

S00894 

626E 

S00776 

BLOCK 

S00893 

7865 

S00774 

PFNB 

S00892 

6F69 

S00772 

PFDV 

S00891 

6F72 

S00770 

64 

S00890 

6F73 

S00759 

CH 

S00889 

7370 

S00757 

PFIO 

S00888 

6B75 

S00756 

N 

S00887 

6460 

S00754 

PFZZ 

S00886 

6472 

S00752 

PFMD 

S00885 

6664 

S00749 

PRODUCT 

S00884 

666D 

S00747 

PFML 

S00883 

6E72 

S00745 

PFSU 

S00882 

6663 

S00742 

SUM 

S00881 

666F 

S00740 

PFAD 

S00880 

6677 

S00735 

PFDD 

S00879 

6672 

S00730 

ENDPTR 

S00878 

7664 

S00728 

PFRO 

S00877 

6C6D 

S00726 

PFSO 

S00876 

7573 

S00722 

CH 

S00875 

6464 

S00720 

PFUK 

S00874 

7361 

S00716 

CHB 

S00873 

6461 

S00715 

CHA 

S00872 

6B70 

S00713 

PFPK 

S00871 

7373 

S00711 

* t 

S00870 

6367 

S00708 

60 

S00869 

7263 

S00698 

1A 

S00868 

6567 

S00696 

'DISK EOF S' 

S00867 

746E 

S00694 

20 

S00866 

6E69 

S00691 

NEXTCHAR 

S00865 

71 65 

S00690 

NOTCOMMENT 

S00864 

736E 

S00689 

CH 

S00863 

PFLIST 

S00688 

K 

S00862 

I 

S00686 

PFRS 

S00860 

CHCH 

S00684 

PFFW 

S00859 

PFINDEX 

S00680 

NOTFIRST 

S00858 

SECONDCH 

S00678 

PFPS 

S00857 

FIRSTCH 

S00676 

PFEX 

S00856 

CH 

S00665 

SEGNUMBER 

S00855 

BLOCK 

S00664 

CHB 

S00854 

BLOCKPTR 

S00663 

CH 

S00853 

NAMECH 

S00662 

LASTARGNUMBER 

S00852 

NAME 

S00660 

STACKOFFSET 

S00851 

NAMEPTR 

S00659 

PFCL 

S00849 

PROCESSENDFUNCTI ON 

S00655 

PFNT 

S00847 

PFRD 

S00653 

8000 

S00840 

RC 

S00651 

PFGE 

S00838 

PFRF 

S00644 

ARGC 

S00830 

21 

S00643 

ARGB 

S00826 

STUFFCH 

S00642 

ARGA 

S00825 

WRITESTATUS 

S00640 

PFEQ 

S00824 

I 

S00637 

PFCR 

S00823 

CH 

S00625 

CH 

S00821 

PFWF 

S00624 

I NPTR 

S00820 

19 

S00622 

PFI N 

S00818 

PFDF 

S00610 

M 

S00815 

PFCF 

S00608 

GCLENGTH 

S00813 

22 

S00604 

ANOTHERCH 

S0081 1 

PFMF 

S00603 

NEGCOUNTFAILED 

S00808 

PFOF 

S00602 

CH 


S00601 BACKUPTO 
S00600 CURRENTCHPTR 
S00599 FORMPTR 
S00598 MARKPTR 
S00597 N 
S00596 NPTR 
S00595 GCPTR 
S00593 PFGC 
S00590 11000000 
S00583 CURRENTBLOCK 
S00582 CURRENTBLOCKPTR 
S00581 CH 
S00579 CHA 
S00578 PUTCHASS 
S00577 MOREFILL 
S00576 ARGNUMBER 
S00574 PFSS 
S00566 CH 
S00564 PFAS 
S00557 PFNS 
S00544 NEXTSTART 
S00533 MATCHHERE 
S00532 RESTARTPTR 
S00531 CHB 
S00530 CHA 
S00528 SSMATCH 
S00525 N 

S00523 NUMBEROFARGS 
S00520 HALFBYTE 
S00519 HEXTOCH 
S00518 57 
S00517 37 
S00515 47 
S00513 '9' 

S00511 CH 

S00510 CHTOHEX 

S00503 NEGATIVE 

S00502 CH 

S00501 N 

S00499 BLOCKPTR 

S00498 STRINGTOBINARY 

S00495 

S00491 '0' 

S00487 NEGATIVE 
S00486 K 
S00485 I 
S00484 D 
S00482 N 

S00481 BINARYTOSTRING 

S00474 CH 

S00473 BLOCK 

S00472 BLOCKPTR 

S00470 PROCESSBEGINFUNCTION 

S00460 CH 

S00459 LASTDELIMWASLEFT 

S00458 DELIMLEVEL 

S00456 PROCESSQUOTEDSTRING 

S00452 BLOCK 

S00451 BLOCKPTR 

S00449 CH 

S00448 NSADDCH 

S00446 'NS STACK OVERFLOW S' 
S00443 FLAGS 

S00442 STARTNEXTARGUMENT 
S00435 NEXT 
S00434 OLDBLOCKPTR 
S00433 CH 

S00431 MOVEPTRFLAG 
S00430 ASNEXTCH 
S00428 ASFREEBLOCK 
S00421 I 
S00420 CLIM 
S00417 ASNSINIT 
S00411 74 

S00409 ' T N I: S' 


Number 24 Dr. Dobb's Journal of Computer Calisthenics & Orthodontia. Box E, Menlo Park, CA 94025 

174 


Page 27 



S00407 IB 
S00405 CH 

S00403 PROCESSCONBREAK 
S00401 TURNTRACEOFF 

S00333 TURNTRACESN 
S00394 TRACEPRINT 
S00392 NEXTNS 
S00391 THIS 
S00389 THISNS 
S00386 60 
S00385 7D 
S00384 '.' 

S00383 7C 
S00382 73 
S00381 70 
S00380 7B 
S00379 IM 
S00376 STREINIT 
S00374 STVALUEPTR 
S00373 STADDVALUE 
S00371 NAMEPTR 
S00370 STCREATE 
S00368 STDELETE 
S00363 11111 
S00360 CH 
S00359 HASH 
S00357 NAMEPTR 
S00356 STFIND 
S00352 STINIT 
S00331 STPREVIOUS 
S00350 STPREVIOUSPTR 
S00349 STENTRY 
S00348 STENTRYPTR 
S00347 HASH INDEX 
S00346 HASHTABLE 
S00342 5000 
S00330 MATCHEND 
S00329 CHA 
S00328 I 
S00327 COUNTMAX 
S00326 COUNT 
S00325 RESTARTPTR 
S00323 ENDMESSAGEPTR 
S00322 RECEIVESTRING 
S00318 CH 
S00316 BLOCKPTR 
S00315 SENDSTRING 
S00311 CLEAROCTOOUTPUT 
S00305 CH 
S00303 BLOCKPTR 
S00302 PRINTSTRING 
S00297 CH 
S00295 BLOCKPTR 
S00294 NULLTEST 
S00287 NEXTB 
S00283 NEXTA 
S00282 CHB 
S00281 CHA 
S00279 PTB 
S00278 PTA 

S00277 STRINGEQUALITY 
S00273 CH 
S00271 SINKPTR 
S00270 SOURCEPTR 
S00269 COPYVALUE 
S00266 NEWCHAIN 
S00265 CH 

S00264 CURRENTBLOCK 
S00262 CHA 

S00261 1NITIALBLOCKPTR 

S00260 PUTCHA 
S00257 NEWCHAIN 
S00256 CH 

S00255 CURRENTBLOCK 
S00254 CHPTR 
S00253 CURRENTBLOCKPTR 
S00251 INITIALBLOCKPTR 
S00250 GETCHB 
S00247 NEWCHAIN 
S00246 CH 

S00245 CURRENTBLOCK 
S00244 CURRENTBLOCKPTR 
S00242 INITIALBLOCKPTR 
S00241 GETCHA 
S00239 OF 
S00233 BLOCKC 
S00232 CHPTR 
S00231 BLOCK 
S00229 BLOCKPTR 
S00228 CH 


Page 28 Dr. Dobb's Journal 


S00227 APPENDCH 
S00222 OFFFO 
S00221 NEXTPTR 
S00220 BLOCK 
SO0218 BLOCKPTR 
S00217 FREECHAIN 
S00213 16 
S00211 BLKPTR 
S00209 MAXADDRESS 
S00208 MINADDRESS 
S00207 FSINIT 
S00206 8181 

S00201 'FREE STORAGE IS EMPTY 

S00199 FIRSTEMPTY 

S00198 GOTC 

S00197 GOT 

S00196 GOTPTR 

S00195 FSFIRST 

S00193 FSGET 

S00192 FREETHIS 

S00190 FREETHISPTR 

S00189 FSFREE 

S00188 NOEXVALUE 

S00187 DEADSTART 

S00186 NULLSTRINGPTR 

S00185 FPTR 

S00184 SPTR 

S00183 VALUECH 

S00182 VALUEPTR 

S00181 ARGPTR 

S00180 NAMEPTR 

S00179 TRACEFLAG 

S00178 SSCHA 

S00177 SSCHCPTR 

S00176 SSCHBPTR 

S00175 SSCHAPTR 

S00174 ASCH 

S00173 ASCHPTR 

S00172 ASBLOCK 

S00171 ASBLOCKPTR 

S00170 NSACT IVEFLAG 

S00169 NSARGBREAK 

S00168 NSCH 

S00167 NSCHPTR 

S00166 NSSAVEINDEX 

S00165 NSSTACKINDEX 

S00164 11 

S00163 NSSTACK 

S00I62 PUTCHACURRENTBLOCKPTR 
S00161 PUTCHACHPTR 
S00160 GETCHACHPTR 
S00159 FIRSTPUTAFLAG 
S00158 FIRSTGETBFLAG 
S00157 FIRSTGETAFLAG 
S00156 FSFIRSTPTR 
S00155 7F 
S00151 65000 
S00149 I 

S00147 RECEIVECH 
S00141 CH 
S00140 SENDCH 
S00137 OCTOSTATUS 
S00136 OCTOCHANNELA 
S00135 135 
S00131 I 
S00129 N 

S00128 WAITTENTH 
S00125 I 
S00123 N 
S00122 WAITMS 
S00121 20 
S00119 7A 
S00118 61 
S00116 CH 
S00115 UPPERCASE 
S00114 14 
S00112 7 

S00108 SELECTOR IVE 
S00107 9 
S00105 MESSPTR 
S00104 PRINTMESS 
S00103 11 
S00101 CONBREAK 
S00099 READCH 
S00095 CH 
S00094 DISPLAYCH 
S00090 CH 
S00089 PRINTCH 
S00088 OA 
S00087 OD 


Computer Calisthenics & Orthodontia, Box E, 



S00086 2 

S00084 CRLF 

S00082 A 

S00081 F 

S00080 M0N2 

S00079 5 

S00077 A 

S00076 F 

S00075 MON 1 

S00074 FBASE 

S00073 6 

S00072 FBASEA 

S00071 I TEMP 

S00070 DUMMY 

S000S9 TEMPPTR 

S00068 CURRENTDRIVE 

S00067 PREVIOUSDRIVE 

S00066 DEFAULTDRIVE 

S00065 PRELOADED 

S00064 7E 

S00063 METACHAR 

S00062 04 

S00061 OCTOEOM 

S00060 TBUFFINDEX 

S00059 TBUFF 

S00058 80 

S00057 TBUFFPTR 

S00056 TFCB 

S00055 5C 

S00054 TFCBPTR 

S00053 120 

S00052 OCTOTIMEOUT 

S00051 1 

S00050 CONBUF 

S00049 CON IN 

S00048 80 

S00047 CONCOLUMN 

S00046 CONWIDTH 

S00045 OFF 

S00044 CPMPRINTFLAG 

S00043 62 

S00042 ATCB 

S00040 6F 

S00039 72 

S00038 ATRO 

S00036 6E 

S00035 69 

S00034 AT IN 

S00032 81 

S00031 63 

S00030 67 

S00029 40 

S00028 0 

S00027 ATGC 

S00025 START 

S00024 100 

S00022 DEC 

S00021 DOUBLE 

S00020 MOVE 

S00019 LAST 

S00018 LENGTH 

S00017 OUTPUT 

S00016 INPUT 

S00015 LOW 

S00014 HIGH 

S00013 TIME 

S00012 SCR 

S00011 SCL 

S00010 SHR 

S00009 SHL 

S00008 ROR 

S00007 ROL 

S00006 STACKPTR 

S00005 MEMORY 

S00004 PARITY 

S00003 SIGN 

S00002 ZERO 

S00001 CARRY 

8080 PLM2 VERS 3.0 


Menlo Park, CA 94025 Number 24 

175 


1=0000030 
100=0004460 
151=0004760 
161=0005420 
167=0005720 
175=000617Q 
186=0006620 
194 = 00071 IQ 
200=0007560 
212=0010150 
221=001126Q 
227=0012230 
253=0012610 
259=0013040 
268=001375Q 
340=0014440 
358=0015420 
366=0016200 
372=0017300 
383=0020460 
392 = 00211 IQ 
398=0021670 
411=0022360 
417=0023010 
424=0023660 
441=0024270 
447=0025240 
463=0025650 
476=0026500 
487=0027200 
498=0030010 
508=0030620 
524=0031650 
537=0032440 
546=0033340 
560=0034530 
572=0035030 
582=0035670 
598=0036240 
604=0037430 
610=0040050 
617=0040550 
624=004115Q 
630=0042660 
662=0043640 
675=0044300 
681=0045120 
692=0046200 
702=0046750 
708=0050220 
718 = 00511 IQ 
730=0051730 
737=0052520 
748=0053530 
762=0054210 
768=0054610 
775=0055030 
785=0055410 
791=0056600 
797=0057210 
813=0057550 
819=0060430 
827=0061210 
835=0061620 
850=0062360 
859=0062740 
865=0063430 
876=0064640 
889=0065560 
895=0066530 
906=0067230 
912=0067740 
918=0070220 
929=0070750 
935=0071340 
947=0071740 
958=0072640 
965=0074340 
971=0075260 
982=0076150 
988=0077500 
996=0100140 
1004=0100570 
1027=0101320 
1035=0102120 
1044=010256Q 
1052=0103320 
1061=010440Q 
1067=0104710 
1084=0105610 
1095=010626Q 
1 102 = 0107130 
1 108 = 011006Q 


18=0004030 
144=0004560 
154=0005070 
162=0005500 
168=0005730 
177=0006300 
187=0006650 
195=0007200 
201=0007570 
214=0010230 
222=001136Q 
244=0012330 
254=0012660 
263=0013140 
269=0014020 
353=001453Q 
359=001553Q 
367=0016340 
373=0017430 
384=0020510 
393=0021270 
402=0021770 
412=0022470 
419 = 00231 IQ 
431=0023740 
442=0024470 
453=0025320 
464=0026050 
481=0026600 
488=0027350 
503=0030060 
512=0030740 
525=0031670 
541=0032510 
551=0033420 
561=0034560 
573=0035270 
583=0036020 
599=0036400 
605=0037460 
611=0040200 
618=0040620 
625=0041220 
631=0043000 
663=0043650 
676=0044340 
682=0045400 
693=0046360 
703=0047030 
709=0050270 
719=005116Q 
731=0052040 
738=0052750 
749=0053550 
763=0054330 
769=0054640 
777 = 00551 IQ 
786=0056010 
792=0056630 
798=0057220 
814=0057640 
820=0060600 
828=0061300 
836=0062010 
851=0062410 
860 = 00631 7Q 
870=0063470 
877=0065230 
890=0065770 
896=0066640 
907=0067300 
913=0070040 
919=0070230 
930=0071060 
936=0071410 
953=0072000 
959=0072700 
966=0074550 
972=0075440 
983=0076210 
989=0077520 
997=0100230 
1005=0100630 
1028=0101370 
1036=0102220 
1045=0102620 
1055=0103460 
1062=0104430 
1079=0104740 
1085=0105700 
1096=0106410 
1 103 = 0107100 
1109=0110320 


96=0004060 
145=0004610 
155=0005200 
163=0005600 
171=0005770 
178=0006310 
188=0006660 
196=0007240 
205=0007630 
215=001072Q 
223=001150Q 
245=0012370 
255=0012710 
264=001333Q 
270=001405Q 
354=001461Q 
361=001556Q 
368=001650Q 
374=0017440 
385=0020520 
394=0021320 
407=0022040 
413=0022570 
420=0023260 
436=0024040 
443=0024630 
458=0025420 
465=002613Q 
483=0026620 
489=0027400 
504=0030340 
517=0030770 
529*003174Q 
542=0032620 
556=0033470 
562=0034650 
574=0035300 
584=0036050 
600=0036720 
606=0037540 
612=0040220 
619=0040670 
626=0042000 
632=0043130 
667=0043730 
677=0044400 
683=0045520 
694=0046440 
704=0047200 
713=0050350 
724=0051210 
732=0052150 
739=0053170 
750=0053700 
764=0054360 
770=0054650 
778=0055120 
787=0056120 
793=0056740 
807=0057250 
815=0057710 
821=0060640 
829=0061330 
837*00621 IQ 
852=0062560 
861=0063250 
872=0063540 
878=0065260 
891=0066040 
897=0067100 
908=0067410 
914=0070030 
925=0070300 
931=00711 IQ 
937*0071550 
954*0072030 
960=0072740 
967=0074660 
973=0075710 
984=0076570 
990=0077550 
998=0100350 
1011=0100700 
1030=010150Q 
1037=010225Q 
1046*0102760 
1056*0103650 
1063=0104510 
1080=0105070 
1086=0106040 
1097=0106550 
1104=0107150 
1 110 = 0110420 


97=0004200 
146=0004620 
157=0005250 
164=0005650 
172=0006010 
181=0006420 
191=0006720 
197=0007310 
206=0007660 
216=0010730 
224=0011650 
246=0012430 
256=0012760 
265=0013420 
333=0014130 
355=001522Q 
363=001570Q 
369=001664Q 
379=001756Q 
388=0020600 
395=0021500 
408=0022160 
414=0022610 
421=0023310 
438=0024060 
444=0024770 
460=0025440 
466=0026310 
484=0026760 
490=0027640 
505=0030430 
518=0031310 
530=0032200 
543=0032670 
557=0034220 
564=0034700 
578=0035360 
585=0036060 
601=0037060 
607=0037570 
614=0040370 
620=0040750 
627=0042270 
633=0043200 
672=0043760 
678=0044730 
684=0045770 
695=0046630 
705=0047420 
715=0050450 
725=0051360 
733=0052310 
740=0053260 
751=0053760 
765=0054440 
772=0054720 
779=0055130 
788=0056200 
794=0056770 
808=0057330 
816=0060070 
822=0060740 
830=0061370 
838=006214Q 
853=0062640 
862=0063320 
873=0064050 
879=0065270 
892=0066120 
898=0067120 
909=0067510 
915=0070140 
926=0070410 
932=0071160 
938=0071600 
955=0072220 
962=0073060 
968=0075100 
974=0076000 
985=0076650 
991=0077770 
999=0100410 
1012=010115Q 
1031=0101610 
1038=0102320 
1047=0103160 
1058=0104010 
1064=0104560 
1 081=010534Q 
1087=0106170 
1098=0106660 
1 105 = 0107370 
1 1 11=011045Q 


98=0004260 
149=0004720 
158=0005260 
165=0005720 
173=0006070 
182=0006430 
192=0006770 
198=0007420 
207=0010030 
219=001101Q 
225=0012020 
250=0012470 
257=001301Q 
266=0013550 
338=001427Q 
356=0015320 
364=0015760 
370=001700Q 
381=0017700 
390=0020720 
396=0021630 
409=0022240 
415=0022720 
422=0023550 
439=0024200 
445=0025150 
461=0025560 
467=0026330 
485=0027060 
491=0027660 
506=0030560 
519=0031330 
531=0032340 
544=0033200 
558=0034340 
565=0034710 
579=0035410 
591=0036140 
602=003715Q 
608=0037720 
615=0040420 
622=0041000 
628=0042360 
634=0043220 
673=0044030 
679=0044750 
685=0046020 
696=0046640 
706=0047650 
716=0050530 
728=005143Q 
734=0052420 
741=0053360 
754=0054030 
766=0054450 
773=0054740 
783=0055210 
789=0056240 
795=005710Q 
811=0057440 
817=0060310 
625=0060760 
831=0061400 
844=0062200 
855=0062700 
863=0063340 
874=0064430 
884=0065330 
893=0066220 
899=0067130 
910=0067550 
916 = 00701 IQ 
927=0070460 
933=0071230 
939=007165Q 
956=0072260 
963=0073110 
969=007513Q 
975=0076010 
986=0076700 
992=0100050 
1002=0100450 
1013=0101220 
1032=0101720 
1039=0102330 
1048=0103260 
1059=0104100 
1065=0104610 
1082=0105510 
1088=0106220 
1099=0106750 
1 106 = 0107620 
1 112 = 011050Q 


99=0004400 
150=0004750 
160=0005320 
166=0005750 
174=0006140 
185=0006510 
193=0007060 
199=0007450 
208=0010070 
220=001107Q 
226=0012220 
252=0012520 
258=0013030 
267=001363Q 
339=001443Q 
357=001534Q 
365=001604Q 
371=0017140 
382=0020370 
391=002114Q 
397=002166Q 
410=0022320 
416=0022740 
423=0023570 
440=0024250 
446=002517Q 
462=0025630 
468=0026400 
486=0027100 
492=0027670 
507=0030610 
523=003144Q 
532=0032360 
545=0033310 
559=0034440 
571=0035000 
581=0035450 
597=0036170 
603=0037300 
609=0040010 
616=0040520 
623=004113Q 
629=0042510 
661=0043270 
674=0044250 
680=0045100 
691=0046120 
700=0046720 
707=0050120 
717=0050630 
729=005162Q 
736=0052470 
742=0053370 
755=0054160 
767=0054540 
774=0054750 
784=0055340 
790=0056440 
796=005716Q 
812=0057470 
818=0060400 
826=006103Q 
634=006154Q 
849=0062230 
656=0062710 
664=0063360 
675=0064450 
688=0065430 
894=0066370 
905=0067200 
911=0067660 
917=0070170 
928=0070700 
934=0071260 
940=0071660 
957=0072370 
964=0073150 
970=0075210 
977=0076070 
987=0077040 
995 = 01001 IQ 
1003=0100500 
1014=0101270 
1034=0102010 
1043=0102470 
1049=0103310 
1060=0104240 
1066=0104700 
1083=0105600 
1089=0106230 
1 101 =0107000 
1 107 = 011002Q 
1113=0110510 


Number 24 

176 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 29 



1123=011054Q 
1133=011 141Q 
1139=011203Q 
1145=011266Q 
1151=011401Q 
1168=011470Q 
1179=0116000 
1186=011667Q 
1192=011733Q 
1199=0120030 
1205=0120550 
1212=0121350 
1218=0122620 
1230=012326Q 

1236=0124230 

1242=0125350 
1248=0126240 
1255=012707Q 
1264=013002Q 
1276=0130500 
1282=0131270 
1292=0132330 
1300=0133100 
1314=0133720 
1320=0134640 
1326=0136130 
1333=0137020 
1347=0137570 
1355=0140140 
1369=0140640 
1376=0141420 
1383=0142150 
1389=0142760 
1396=0143410 
1403=014412Q 
1415=0144550 
1421=014560Q 
1431=0146640 
1439=0147300 
1450=015004Q 
1457=0150640 
1463=0151430 
1479 = 01521 IQ 
1490=0152730 
1502=015466Q 
1513=015566Q 
1526=0156210 
1532=015731Q 
1538=016003Q 
1556=0160730 
1562=016156Q 
1572=0162300 
1586=0163010 
1594=0164330 
1600=0165000 
1608=0165250 
1617=0166520 
1625=0167300 
1633=016760Q 
1641=017030Q 
1649=0171000 
1660=0171550 
1667=0172310 
1674=0173240 
1680=0174340 
1691=0175050 
1697=0176040 
1703=0177140 
1714=0177440 
1777=0200240 
1784=0201250 
1792=0202070 
1799=0202770 
1805=0204230 
1811=0204720 
1817=0205360 
1823=0206020 
1829=0206460 
1835=0207120 
1841=0207600 
1847=021173Q 
1857 = 02131 IQ 
1864=0213700 
1872=0214400 
1878=0215340 
1884=0216150 
1892=021665Q 
1905=021747Q 
1912=0220210 
1919=0220640 
1925=0222240 
1931=0223300 
1937=0223750 
1943=0224250 
1952=0224670 
1958=0225260 


1124=0110600 
1134=011143Q 
1140=0112100 
1146=011314Q 
1152=0114140 
1169=011472Q 
1180=0116200 
1187=011672Q 
1193=0117510 
1200=0120110 
1206=012066Q 
1213=0121500 
1225=0122650 
1231=012354Q 
1237=0124300 
1243=0125400 
1249=0126330 
1256=0127160 
1265=013007Q 
1277=0130630 
1283=0131300 
1293=0132420 
1301=0133240 
1315=0133770 
1321=0135140 
1327=0136210 
1337=0137050 
1348=0137720 
1356=0140200 
1370=014110Q 
1378=0141450 
1384=0142200 
1390=0143010 
1397=0143470 
1410=0144150 
1416=0144610 
1426=0145630 
1432=0147060 
1445=0147360 
1451=0150070 
1458=0150700 
1464=0151440 
1480=0152270 
1491=0152770 
1503=0154770 
1514=0155670 
1527=0156260 
1533=0157400 
1539=0160040 
1557=0161030 
1563=0161570 
1573=0162350 
1589=0163060 
1595=0164400 
1601=016502Q 
1610=0165350 
1618=016653Q 
1626=0167330 
1634=0167630 
1642=017036Q 
1650=0171070 
1661=0171710 
1668=017253Q 
1675=0173520 
1685=017437Q 
1692=0175160 
1698=0176100 
1704=0177230 
1715=0177450 
1778=0200320 
1785=020127Q 
1793=0202250 
1800=0203230 
1806=0204340 
1812=0205000 
1818=0205440 
1824=0206100 
1830=0206540 
1836=0207200 
1842=0207660 
1848=0212070 
1858=021325Q 
1865=0213730 
1873=0214610 
1879=021540Q 
1885=0216220 
1900=0216730 
1906=0217730 
1913=0220310 
1920=022107Q 
1926=0222270 
1932=0223330 
1938=0224000 
1945=0224300 
1953=0225000 
1959=0225310 


1129=011064Q 
1135=011144Q 
1141=011226Q 
1147*011333Q 
1153*0114170 
1175=0115020 
1181*0116230 
1188*011700Q 
1194*0117560 
1201*0120150 
1207=0120730 
1214*0121630 
1226*0122730 
1232*0123710 
1238*0124340 
1244=0125520 
1250=0126470 
1257=0127420 
1272*0130120 
1278*0130640 
1288*0131330 
1296=0132450 
1302=0133470 
1316*0134070 
1322*0135230 
1328*0136470 
1338*0137130 
1349=0137670 
1357-014025Q 
1371-014115Q 
1379*0141530 
1385-0142270 
1392=0143060 
1398=014352Q 
1411*0144230 
1417*0144700 
1427*0145760 
1433*01471 IQ 
1446=0147510 
1452*0150140 
1459=0151010 
1468=0151470 
1481=0152510 
1492=0153340 
1504*015510Q 
1518*0155720 
1528=015650Q 
1534=015755Q 
1546=016007Q 
1558=0161170 
1566=0161620 
1574=0162500 
1590=0163440 
1596=0164510 
1602=0165100 
1611=0165610 
1621*0166560 
1627=0167410 
1635=0170130 
1643=0170600 
1651=0171100 
1662=0171750 
1669=0172670 
1676=0174000 
1686=017456Q 
1693=0175410 
1699=0176270 
1705=0177260 
1730=0177500 
1779=0200350 
1787=0201430 
1794=0202350 
1801=0203530 
1807=0204420 
1813=0205060 
1819=0205520 
1825=0206160 
1831*0206620 
1837=0207260 
1843=0207740 
1853=0212130 
1859=0213410 
1866*0214310 
1874*0214720 
1 880 = 021551Q 
1886=0216440 
1901=021706Q 
1907=021776Q 
1915=0220330 
1921=022174Q 
1927=0222520 
1933=0223540 
1939=0224100 
1948=0224350 
1954=0225030 


1130=0110740 
1136=011147Q 
1142=011237Q 
1148=011343Q 
1154=011420Q 
1176=0115070 
1182=0116310 
1189=0117030 
1195=0117650 
1202=0120250 
1208=0120750 
1215=0122250 
1227=0122760 
1233=0124020 
1239=0124430 
1245=0125550 
1251=0126630 
1258=0127430 
1273=0130200 
1279=0131070 
1289=0131620 
1297=0132530 
1303=0133620 
1317=0134330 
1323=0135400 
1329=0136730 
1339=0137220 
1350=0140050 
1366=0140300 
1372=014116Q 
1380=0141600 
1386=0142320 
1393 = 01431 IQ 
1399=0143710 
1412=0144260 
1418=0145210 
1428=0145730 
1434=0147120 
1447=014754Q 
1453=0150360 
1460=0151140 
1469=0151620 
1482=0152560 
1493=0153350 
1505=0155110 
1519=0156020 
1529=0156610 
1535=0157620 
1547=0160130 
1559=0161240 
1567=0162160 
1575=0162610 
1591=0163520 
1597=0164540 
1603=016513Q 
1612=0166070 
1622=0166620 
1628=0167420 
1636=0170160 
1644=0170630 
1657=017113Q 
1663=0172100 
1670 = 01731 IQ 
1677=0174030 
1687=0174670 
1694=0175460 
1700=0176470 
1706=0177270 
1731=0177560 
1781=0200420 
1788=0201510 
1796=0202320 
1802=0203760 
1808=0204500 
1814=0205140 
1820=0205600 
1826=0206240 
1832=0206700 
1838=0207340 
1844=0210020 
1854=0212200 
1860=0213530 
1867=0214340 
1875=0214750 
1881=0215650 
1887=0216500 
1902=0217230 
1908=0217770 
1916=0220370 
1922=0222020 
1928=0222770 
1934=0223570 
1940=0224120 
1949=0224460 
1955=0225140 


1131=011101Q 
1137=011161Q 
1143=0112530 
1149=011362Q 
1166=011423Q 
1177=0115210 
1184=0116370 
1190=0117140 
1196=011774Q 
1203=0120330 
1209=0121240 
1216=0122350 
1228=0123070 
1234=0124100 
1240=0124570 
1246=0125710 
1252=0126660 
1262=0127460 
1274=0130230 
1280=0131230 
1290=0132170 
1298=0132640 
1305=0133630 
1318=0134410 
1324=0135520 
1330=0136760 
1340=0137340 
1351=0140100 
1367=0140410 
1374=0141310 
1381=0141700 
1387=0142370 
1394=0143210 
1400=0144060 
1413=0144340 
1419=0145540 
1429=0146070 
1437=014715Q 
1448=0147650 
1454=0150420 
1461=0151170 
1470=0152000 
1483=0152670 
1500=0153450 
1511=0155140 
1520=0156030 
1530=0157010 
1536=0157730 
1548=0160570 
1560=0161340 
1568=0162170 
1576=0162720 
1592=0164170 
1598=0164570 
1604=0165160 
1613=0166130 
1623=0166750 
1631=0167450 
1637=0170240 
1645=0170710 
1658=0171250 
1664=0172230 
1671=0173140 
1678=0174110 
1688=0174760 
1695=0175720 
1701=0176530 
1712=0177340 
1775=0177620 
1782=0200660 
1789=0201570 
1797=0202560 
1803=0204040 
1809=0204560 
1815=0205220 
1821=0205660 
1827=0206320 
1833=0206760 
1839=0207420 
1845=0210230 
1855=0212430 
1861=0213550 
1870=0214310 
1876=0215050 
1882=0216000 
1888=0216530 
1903=0217300 
1910=0220100 
1917=0220460 
1923=0222160 
1929=0223130 
1935=0223640 
1941=0224150 
1950=0224510 
1956=0225170 


1132=011115Q 
1138*011165Q 
1144=011262Q 
1150=0113760 
1167=011445Q 
1178=0115460 
1185=0116520 
1191=0117250 
1197=0117750 
1204=0120410 
1210=0121270 
1217=0122610 
1229=0123200 
1235=0124150 
1241=012501Q 
1247=0125770 
1254=0126740 
1263=0127600 
1275=0130360 
1281=0131240 
1291=0132220 
1299=0133020 
1309=0133670 
1319=0134460 
1325=0135710 
1332=0137010 
1346=0137410 
1352 = 01401 10 
1368=0140430 
1375=0141350 
1382=0142060 
1388=0142530 
1395=0143250 
1401=01441 IQ 
1414=0144440 
1420=0145570 
1430=0146370 
1438=0147270 
1449=014776Q 
1455=0150530 
1462=0151300 
1471=0152010 
1484=0152700 
1 501=0153630 
1512=0155200 
1525=0156060 
1531=0157120 
1537=0160000 
1 549 = 0160600 
1561=0161450 
1571=0162220 
1577=016273Q 
1593=0164250 
1599=016462Q 
1605=016517Q 
1616=0166230 
1624=016700Q 
1632=0167510 
1638=0170250 
1646=0170720 
1659=0171350 
1665=0172240 
1672=0173170 
1679=0174330 
1690=0175010 
1696=0175750 
1702=0176740 
1713=0177410 
1776=0177730 
1783=0201200 
1791=0201650 
1798=0202640 
1804=0204070 
1610=0204640 
1816=0205300 
1822=0205740 
1828=0206400 
1834=0207040 
1840=0207500 
1846=0210340 
1856=0213010 
1863=0213630 
1871=0214360 
1877=0215200 
1883=0216100 
1889=0216640 
1904=0217340 
1911=0220140 
1918=0220560 
1924=0222210 
1930=0223160 
1936=0223740 
1942=0224200 
1951=0224620 
1957=0225220 

Number 24 


Page 30 



S00001 22744Q S00002 22744Q S00003 22744Q S00004 22744Q 
S00005 25000Q S00006 22744Q S00023 22744Q S00044 22744Q 
S00046 22745Q S00047 22746Q S00049 22747Q S00030 22750Q 
S00052 23072Q S00054 23074Q S00057 23076Q S00060 23101Q 
S00061 23102Q S00063 23103Q S00065 23104Q S00066 23105Q 
S00067 23106Q S00068 23107Q S00069 23110Q S00070 23112Q 
S00071 23113Q S00072 23114Q S00076 23117Q S00077 23120Q 
S00081 23123Q S00082 23124Q S00090 23126Q S00095 23127Q 
S00105 23130Q S00116 23133Q S00123 23134Q S00125 23136Q 
S00129 23140Q S00131 23142Q S00136 23144Q S00141 23145Q 
S00149 23146Q S00156 23150Q S00137 23153Q S00158 23154Q 
S00159 23155Q S00160 23156Q S00161 23160Q S00162 23162Q 
S00163 23164Q S00165 24162Q S00166 24163Q S00167 24164Q 
S00169 24166Q S00170 24167Q S00171 24170Q S00173 24172Q 
S00175 24174Q S00176 24176Q S00177 24200Q S00179 24203Q 
S00180 24204Q S00181 24206Q S00182 2421OQ S00184 24212Q 
S00185 24214Q S00186 24216Q S00187 24220Q S00188 24221Q 
S00190 24222Q S00196 24224Q S00199 24227Q S00208 24230Q 
S00209 24232Q S00211 24234Q S00218 24236Q S00221 24240Q 
S00228 24243Q S00229 24244Q S00232 24246Q S00242 24250Q 
S00244 24252Q S00247 24255Q S00251 24256Q S00253 24260Q 
S00254 24262Q S00257 24265Q S00261 24266Q S00262 24270Q 
S00266 24271Q S00270 24272Q S00271 24274Q S00273 24277Q 
S00278 24300Q S00279 24302Q S00281 24304Q S00282 24305Q 
S00295 24306Q S00297 2431 IQ S00303 24312Q S00305 24315Q 
S00316 24316Q S00318 24321Q S00323 24322Q S00325 24324Q 
S00326 24326Q S00327 24330Q S00328 24332Q S00329 24335Q 
S00346 24336Q S00347 24437Q S00348 24440Q S00350 24442Q 
S00357 24444Q S00359 24446Q S00360 24447Q S00371 24450Q 
S00374 24452Q S00391 24454Q S00405 24456Q S00421 24457Q 
S00431 24460Q S00433 24461Q S00434 24462Q S00443 24464Q 
S00449 24465Q S00451 24466Q S00458 24471Q S00459 24472Q 
S00460 24473Q S00472 24474Q S00474 24477Q S00482 24500Q 
S00484 24503Q S00485 2451 IQ S00486 24512Q S00487 24513Q 
S00499 24514Q S00501 24516Q S00502 24521Q S00503 24522Q 
S00511 24523Q S00520 24524Q S00525 24525Q S00530 24526Q 
S00531 24527Q S00532 24530Q S00566 24532Q S00576 24533Q 
S00577 24534Q S00579 24535Q S00582 24536Q S00595 24540Q 
S00596 24542Q S00597 24544Q S00598 24546Q S00599 24550Q 
S00600 24552Q S00601 24554Q S00602 24556Q S00603 24557Q 
S00610 24560Q S00624 24562Q S00625 24565Q S00642 24566Q 
S00643 24570Q S00644 24572Q S00660 24574Q S00662 24575Q 
S00663 24576Q S00664 24577Q S00665 24600Q S00680 24601Q 
S00688 24602Q S00689 24603Q S00690 24604Q S00715 24605Q 
S00716 24606Q S00722 24607Q S00730 2461OQ S00742 24612Q 
S00749 24614Q S00756 24616Q S00759 24621Q S00777 24622Q 
S00787 24624Q S00789 24627Q S00790 24630Q S00791 24631Q 
S00803 24632Q S00823 24635Q S00824 24636Q S00825 24637Q 
S00840 24640Q S00851 24642Q S00854 24644Q S00856 24647Q 
S00857 24650Q S00858 24651Q S00860 24652Q S00862 24655Q 
S00863 24656Q S00973 24777Q SOI 004 22743Q SOI 005 22742Q 
SOI 006 22740Q SOI 008 22736Q SOI 010 22734Q SOI Oil 22732Q 
SOI 013 22730Q S01014 22726Q S01015 22724Q S01016 22722Q 
SOI 017 22720Q SOI 018 22716Q SOI 019 22714Q SOI 021 22712Q 


STACK SIZE = 18 

BYTES 







000400Q 

LX I SP 

22712Q 

JMP 

22021 Q 





000406Q 

000Q 

OOOQ 100Q 

147Q 143C 

1 201Q i 

OOOQ OOOQ 

OOOQ OOOQ 



000420Q 

OOOQ 

OOOQ 1OOQ 

151Q 156C 

1 201 Q 





000426Q 

OOOQ 

OOOQ 1OOQ 

162Q 157C 

1 201Q i 

OOOQ OOOQ 

OOOQ OOOQ 



000440Q 

OOOQ 

OOOQ 1OOQ 

143Q 142C 

1 201 Q 





000446Q 

LX I H 

23117Q 

MOV MC 


INR L 


MOV ME 


000454Q 

I NX H 


MOV MD 


JMP 

5Q 

RET 


000462Q 

LX! H 

23123Q 

MOV MC 


INR L 


MOV ME 


000470Q 

I NX H 


MOV MD 


JMP 

3Q 

RET 


000476Q 

MOV Cl 

2Q 

MOV El 

15Q 

MOV D1 

OQ 

CALL 

446Q 

000507Q 

MOV Cl 

2Q 

MOV El 

1 2Q 

MOV Dl 

OQ 

CALL 

446Q 

000520Q 

LX I H 

22746Q 

MOV MI 

OQ 

RET 


LXI H 

23126Q 

000531Q 

MOV MC 


MOV Cl 

2Q 

MOV EM 


MOV Di 

OQ 

000537Q 

CALL 

446Q 

LX I H 

23126Q 

MOV AM 


sub r 

1 5Q 

000550Q 

JNZ 

5600 

DCR H 


MOV LI 

346Q 

MOV MI 

OQ 

000560Q 

LX I H 

22746Q 

INR M 


MOV AM 


DCR L 


000566Q 

SUB M 


CZ 

476Q 

RET 


LXI H 

23127Q 

000576Q 

MOV MC 


IN 

IQ 

RRC 


RRC 


000603Q 

RRC 


JC 

577Q 

LXI H 

23127Q 

MOV AM 


000613Q 

CMA 


OUT 

OQ 

RET 


MOV Cl 

IQ 

000621Q 

MOV El 

OQ 

MOV DI 

OQ 

CALL 

462Q 

RET 


000631Q 

MOV Cl 

13Q 

MOV El 

OQ 

MOV Dl 

OQ 

CALL 

462Q 

000642Q 

RET 


LX I H 

23130Q 

MOV MC 


1 NX H 


000650Q 

MOV MB 


MOV Cl 

1 IQ 

DCR L 


MOV EM 


000655Q 

I NR L 


MOV DM 


CALL 

446Q 

CALL 

476Q 

000665Q 

RET 


LHLD 

23074Q 

MOV AM 


SUB 1 

OQ 

000674Q 

JNZ 

71 IQ 

LX I H 

23105Q 

MOV CM 


MOV LI 

107Q 

000705Q 

MOV MC 


JMP 

731Q 

LHLD 

23074Q 

MOV AM 


000715Q 

ANA I 

7Q 

DCR A 


LXI H 

23107Q 

MOV MA 


000724Q 

LHLD 

23074Q 

MOV MI 

OQ 

LXI H 

23106Q 

MOV AM 


000735Q 

I NR L 


SUB M 


JZ 

756Q 

MOV CM 


000743Q 

DCR L 


MOV MC 


MOV Cl 

16Q 

INR L 


000750Q 

MOV EM 


MOV DI 

OQ 

CALL 

446Q 

RET 


000757Q 

LX 1 H 

23133Q 

MOV MC 


MOV AM 


SUB I 

1 41Q 

000766Q 

SBC A 


MOV CA 


MOV AI 

1 72Q 

SUB M 


000773Q 

SBC A 


ORA C 


RRC 


JNC 

1003Q 

001001Q 

MOV AM 


RET 


MOV AM 


SUB 1 

40Q 

001006Q 

RET 


LX I H 

23134Q 

MOV MC 


I NX H 



Number 24 Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 Page 31 


178 



001014Q 

MOV 

MB 


INR 

L 


MOV 

Ml 

OQ 

I NX 

H 


001021Q 

MOV 

MI 

00 

LX I 

H 

23136Q 

MOV 

AM 

I NR 

L 


001030Q 

MOV 

BM 


MOV 

LI 

134Q 

SUB 

M 


I NR 

L 


001035Q 

MOV 

CA 


MOV 

AB 


SBC 

M 


JNC 


1072Q 

001043Q 

MOV 

AI 

7Q 

MOV 

B1 

140 

MOV 

CB 


DCR 

C 

001051Q 

JNZ 


10500 

DCR 

A 


JNZ 


1047Q 

LHLD 

231360 

001063Q 

I NX 

H 


SHLD 

23136Q 

JMP 


1023Q 

RET 



001073Q 

LX I 

H 

23140Q 

MOV 

MC 


I NX 

H 


MOV 

MB 


001101Q 

1 NR 

L 


MOV 

MI 

10 

I NX 

H 


MOV 

MI 

OQ 

001107Q 

LX I 

H 

231400 

MOV 

AM 


INR 

L 


MOV 

BM 


001115Q 

I NR 

L 


SUB 

M 


INR 

L 


MOV 

CA 


001121Q 

MOV 

AB 


SBC 

M 


JC 


1222Q 

CALL 

631 Q 

001131Q 

RRC 



RC 



MOV 

AI 

377Q 

MOV 

B1 

14Q 

001137Q 

MOV 

CB 


DCR 

C 


JNZ 


1 1 40Q 

DCR 

A 


001145Q 

JNZ 


11370 

MOV 

AI 

377Q 

MOV 

B1 

14Q 

MOV 

CB 


001155Q 

DCR 

C 


JNZ 


1 155Q 

DCR 

A 


JNZ 


1154Q 

001165Q 

MOV 

A I 

207Q 

MOV 

BI 

14Q 

MOV 

CB 


DCR 

C 


001173Q 

JNZ 


1 1 72Q 

DCR 

A 


JNZ 


11710 

LX I 

H 

23142Q 

0012050 

MOV 

CM 


1 NR 

L 


MOV 

BM 


LX I 

H 

IQ 

001213Q 

DAD 

B 


SHLD 

231420 

JMP 


1 1 07Q 

RET 

001223Q 

LX I 

H 

23144Q 

MOV 

AM 


RRC 



JNC 


1237Q 

001233Q 

IN 


5Q 

CMA 



RET 



I N 


7Q 

001241Q 

CMA 



RET 



LX I 

H 

231450 

MOV 

MC 

001247Q 

CALL 

1223Q 

RRC 



RRC 

CMA 


001235Q 

RRC 



JC 


1247Q 

MOV 

AM 


RRC 



0012630 

JNC 


1276Q 

INR 

L 


MOV 

AM 


CMA 



001271Q 

OUT 


4Q 

JMP 


1303Q 

INR 

L 


MOV 

AM 


001300Q 

CMA 



OUT 


6Q 

RET 



LX I 

H 

23146Q 

001307Q 

MOV 

Ml 

00 

I NX 

H 


MOV 

Ml 

OQ 

MOV 

A I 

3500 

0013160 

MOV 

BI 

375Q 

LX 1 

H 

23146Q 

SUB 

M 


INR 

L 


001325Q 

MOV 

CA 


MOV 

AB 


SBC 

M 


JC 


1402Q 

001333Q 

CALL 

1223Q 

RRC 



JNC 


1363Q 

MOV 

AM 

001343Q 

RRC 



JNC 


1 3350 

IN 


4Q 

CMA 


001352Q 

ANA 

I 

1770 

RET 



IN 


6Q 

CMA 



001360Q 

ANA 

I 

1 77Q 

RET 



MOV 

LI 

1 460 

MOV 

CM 


001366Q 

I NR 

L 


MOV 

BM 


LX I 

H 

IQ 

DAD 

B 


001374Q 

SHLD 

231460 

JMP 


1314Q 

MOV 

A I 

377Q 

RET 


001405Q 

LX I 

H 

24222Q 

MOV 

MC 


I NX 

H 

MOV 

MB 


001413Q 

LX I 

H 

23150Q 

MOV 

CM 


INR 

L 


MOV 

BM 


001421Q 

LHLD 

242220 

MOV 

MC 


I NX 

H 


MOV 

MB 


001427Q 

LX I 

H 

24222Q 

MOV 

CM 


INR 

L 


MOV 

BM 


001435Q 

LX I 

H 

23150Q 

MOV 

MC 


I NX 

H 


MOV 

MB 


001443Q 

RET 



LX I 

H 

23150Q 

MOV 

CM 


INR 

L 


001451Q 

MOV 

BM 


MOV 

CB 


MOV 

AC 


SUB 

1 

OQ 

0014560 

JNZ 


15560 

JMP 


1314Q 






001464Q 

106Q 

122Q 1 050 

105Q 

040Q 123Q 

1 24Q 117Q 

122Q 1 01Q 

1070 105Q 0400 

001502Q 

1 23Q l 

040Q 105Q 

1 15Q 

120Q 124Q 

1 31Q 040Q 

040Q 044Q 




001514Q 

LX 1 

B 

1464Q 

CALL 

643Q 

LX I 

H 

24227Q 

MOV 

AM 


001526Q 

RRC 



JNC 


1542Q 

MOV 

MI 

OQ 

LX I 

SP 

22712Q 

001537Q 

JMP 


403Q 

MOV 

Cl 

OQ 

MOV 

El 

00 

MOV 

DI 

OQ 

001550Q 

CALL 

446Q 

JMP 


1743Q 

DCR 

L 


MOV 

CM 

001560Q 

I NR 

L 


MOV 

BM 


LX I 

H 

24224Q 

MOV 

MC 


001566Q 

1 NX 

H 


MOV 

MB 


LHLD 

23150Q 

MOV 

AM 


001574Q 

I NX 

H 


MOV 

BM 


LX 1 

H 

23150Q 

MOV 

MA 


0016020 

I NX 

H 


MOV 

MB 


LHLD 

24224Q 

MOV 

Ml 

OQ 

00161 IQ 

1 NX 

H 


MOV 

Ml 

OQ 

DCX 

H 


1 NX 

H 

001616Q 

1 NX 

H 


MOV 

Ml 

201Q 

I NX 

H 


MOV 

Ml 

201Q 

001624Q 

LX I 

B 

4Q 

LHLD 

24224Q 

DAD 

B 


MOV 

MI 

20 IQ 

001635Q 

I NX 

H 


MOV 

MI 

201Q 

LX I 

B 

6Q 

LHLD 

24224Q 

001646Q 

DAD 

B 


MOV 

MI 

2010 

I NX 

H 


MOV 

MI 

2010 

001654Q 

LX I 

B 

100 

LHLD 

24224Q 

DAD 

B 


MOV 

MI 

201Q 

0016650 

I NX 

H 


MOV 

MI 

201 Q 

LX I 

B 

12Q 

LHLD 

24224Q 

0016760 

DAD 

B 


MOV 

MI 

201Q 

I NX 

H 


MOV 

MI 

201 Q 

001704Q 

LX I 

B 

14Q 

LHLD 

24224Q 

DAD 

B 


MOV 

MI 

201 Q 

001715Q 

I NX 

H 


MOV 

Ml 

201Q 

LX I 

B 

16Q 

LHLD 

24224Q 

001726Q 

DAD 

B 


MOV 

MI 

201 Q 

I NX 

H 


MOV 

Ml 

201 Q 

001734Q 

LX I 

H 

242240 

MOV 

AM 


INR 

L 


MOV 

BM 

001742Q 

RET 



RET 



LX I 

H 

24230Q 

MOV 

MC 


001750Q 

I NX 

H 


MOV 

MB 


INR 

L 


MOV 

ME 


001754Q 

I NX 

H 


MOV 

MD 


MOV 

LI 

230Q 

MOV 

CM 


001761Q 

I NR 

L 


MOV 

BM 


MOV 

LI 

234Q 

MOV 

MC 


001766Q 

I NX 

H 


MOV 

MB 


LX I 

H 

24232Q 

MOV 

AM 


001774Q 

I NR 

L 


MOV 

BM 


SUB 

I 

20Q 

MOV 

CA 


002001Q 

MOV 

AB 


SBC 

I 

OQ 

MOV 

BA 


MOV 

AC 


002006Q 

1 NR 

L 


SUB 

M 


INR 

L 


MOV 

CA 


002012Q 

MOV 

AB 


SBC 

M 


JC 


205 IQ 

JMP 

2037Q 

002022Q 

LX I 

B 

20Q 

LHLD 

24234Q 

DAD 

B 


SHLD 

24234Q 

002034Q 

JMP 


1770Q 

DCR 

L 


MOV 

CM 


INR 

L 

002042Q 

MOV 

BM 


CALL 

1403Q 

JMP 


20220 

RET 



002052Q 

LX I 

H 

242360 

MOV 

MC 


I NX 

H 


MOV 

MB 


002060Q 

DCR 

L 


MOV 

AM 


INR 

L 


MOV 

BM 


002064Q 

ANA 

I 

360Q 

MOV 

CA 


MOV 

AB 


ANA 

I 

377Q 

002072Q 

DCR 

L 


MOV 

MC 


1 NX 

H 


MOV 

MA 

0020760 

MOV 

BA 


MOV 

AC 


MOV 

LI 

2160 

SUB 

M 


002103Q 

INR 

L 


MOV 

CA 


MOV 

AB 


SBC 

M 


002107Q 

ORA 

C 


RZ 



LX 1 

H 

24236Q 

MOV 

CM 


002115Q 

INR 

L 


MOV 

BM 


MOV 

CB 


MOV 

AC 


002121Q 

SUB 

I 

OQ 

RZ 



LHLD 

24236Q 

MOV 

AM 


002130Q 

1 NX 

H 


MOV 

BM 


LX 1 

H 

24240Q 

MOV 

MA 


002136Q 

I NX 

H 


MOV 

MB 


MOV 

LI 

236Q 

MOV 

CM 


002143Q 

I NR 

L 


MOV 

BM 


CALL 

1 405Q 

LX I 

H 

24240Q 

0021530 

MOV 

CM 


INR 

L 


MOV 

BM 


MOV 

LI 

236Q 

002160Q 

MOV 

MC 


I NX 

H 


MOV 

MB 


JMP 

21110 

0021660 

RET 



LX I 

H 

24243Q 

MOV 

MC 


INR 

L 


Page 32 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 24 

179 



Number 24 


002174Q 

MOV 

ME 


I NX H 


MOV 

MD 


DCR L 


002200Q 

MOV 

CM 


INR L 


MOV 

BM 


MOV CB 


002204Q 

MOV 

AC 


SUB 1 

OQ 

JNZ 


221 6Q 

XRA A 


002213Q 

MOV 

B 1 

00 

RET 


LHLD 

24244Q 

MOV AM 


002222Q 

I NX 

H 


MOV BM 


MOV 

CB 


XRA A 


002226Q 

SUB 

C 


JNC 

2247Q 

DCX 

H 


MOV AM 


002234Q 

I NX 

H 


MOV BM 


LX I 

H 

24244Q 

MOV MA 


002242Q 

I NX 

H 


MOV MB 


JMP 


2216Q 

LX I B 

2Q 

0022520 

LHLD 

24244Q 

DAD B 


SHLD 

24246Q 

LHLD 

24246Q 

002264Q 

MOV 

AM 


SUB I 

201Q 

JZ 


2301 Q 

I NX H 


002273Q 

SHLD 

24246Q 

JMP 

226 IQ 

LX I 

H 

24243Q 

MOV CM 


002305Q 

LHLD 

24246Q 

MOV MC 


I NX 

H 


SHLD 

24246Q 

002315Q 

XCHO 


MOV AE 


ANA 

I 

17Q 

SUB I 

OQ 

002323Q 

JNZ 


2357Q 

CALL 

1 444Q 

LHLD 

24244Q 

MOV MA 


002335Q 

I NX 

H 


MOV MB 


LX I 

H 

24246Q 

MOV MA 


002343Q 

I NX 

H 


MOV MB 


LX I 

B 

2Q 

LHLD 

24246Q 

002353Q 

DAD 

B 


SHLD 

24246Q 

LX I 

H 

24246Q 

MOV AM 


002363Q 

I NR 

L 


MOV BM 


RET 



LX I H 

24250Q 

002371Q 

MOV 

MC 


I NX H 


MOV 

MB 


LX I H 

23153Q 

002377Q 

MOV 

AM 


RRC 


JNC 


2427Q 

MOV MI 

OQ 

002406Q 

LX! 

H 

24250Q 

MOV CM 


INR 

L 


MOV BM 


002414Q 

INR 

L 


MOV MC 


I NX 

H 


MOV MB 


002420Q 

LHLD 

24252Q 

I NX H 


SHLD 

23156Q 

LHLD 

23156Q 

002432Q 

I NX 

H 


SHLD 

23156Q 

XCHG 


MOV AE 


002440Q 

ANA 

I 

17Q 

SUB 1 

OQ 

JNZ 


251 7Q 

LX I H 

23156Q 

002452Q 

MOV 

AM 


INR L 


MOV 

BM 


SUB I 

20Q 

002457Q 

MOV 

CA 


MOV AB 


SBC 

I 

OQ 

LX I H 

24252Q 

002466Q 

MOV 

MC 


I NX H 


MOV 

MA 


LHLD 

24252Q 

002474Q 

MOV 

AM 


I NX H 


MOV 

BM 


LX I H 

24252Q 

002502Q 

MOV 

MA 


I NX H 


MOV 

MB 


LX I B 

2Q 

002510Q 

LHLD 

24252Q 

DAD B 


SHLD 

23156Q 

LHLD 

23156Q 

002522Q 

MOV 

AM 


RET 


LX I 

H 

24256Q 

MOV MC 


002530Q 

I NX 

H 


MOV MB 


LX I 

H 

23154Q 

MOV AM 


002536Q 

RRC 



JNC 

2565Q 

MOV 

MI 

OQ 

LX I H 

24256Q 

002547Q 

MOV 

CM 


INR L 


MOV 

BM 


INR L 


002553Q 

MOV 

MC 


I NX H 


MOV 

MB 


LHLD 

24260Q 

002561Q 

I NX 

H 


SHLD 

24262Q 

LHLD 

24262Q 

I NX H 


002571Q 

SHLD 

24262Q 

XCHG 


MOV 

AE 


ANA I 

17Q 

002600Q 

SUB 

I 

OQ 

JNZ 

2633Q 

LHLD 

24260Q 

MOV AM 


00261 IQ 

1 NX 

H 


MOV BM 


LX I 

H 

24260Q 

MOV MA 


002617Q 

I NX 

H 


MOV MB 


LX I 

B 

2Q 

LHLD 

24260Q 

002627Q 

DAD 

B 


SHLD 

24262Q 

LHLD 

242620 

MOV AM 


002637Q 

RET 



LX I H 

24266Q 

MOV 

MC 


I NX H 


002645Q 

MOV 

MB 


INR L 


MOV 

ME 


LX I H 

23155Q 

002653Q 

MOV 

AM 


RRC 


JNC 


271 OQ 

MOV MI 

OQ 

002662Q 

LX! 

H 

24266Q 

MOV CM 


INR 

L 


MOV BM 


002670Q 

LX! 

H 

23162Q 

MOV MC 


I NX 

H 


MOV MB 


002676Q 

LX! 

B 

20 

LHLD 

23162Q 

DAD 

B 


SHLD 

23160Q 

002710Q 

LX I 

H 

24270Q 

MOV CM 


LHLD 

23160Q 

MOV MC 


002720Q 

I NX 

H 


SHLD 

23160Q 

XCHG 


MOV AE 


002726Q 

ANA 

I 

17Q 

SUB I 

OQ 

JNZ 


2766Q 

CALL 

1444Q 

002740Q 

LHLD 

23162Q 

MOV MA 


I NX 

H 


MOV MB 


002746Q 

LX! 

H 

23162Q 

MOV MA 


I NX 

H 


MOV MB 


002754Q 

LX 1 

B 

2Q 

LHLD 

23162Q 

DAD 

B 


SHLD 

23160Q 

002766Q 

RET 



LX I H 

24272Q 

MOV 

MC 


I NX H 


002774Q 

MOV 

MB 


INR L 


MOV 

ME 


I NX H 


003000Q 

MOV 

MD 


LX I H 

23153Q 

MOV 

MI 

377Q 

MOV LI 

1 55Q 

003010Q 

MOV 

MI 

377Q 

LX I H 

24272Q 

MOV 

CM 


I NR L 


003017Q 

MOV 

BM 


CALL 

2366Q 

LX I 

H 

24277Q 

MOV MA 


003027Q 

SUB 

I 

201Q 

JZ 

3061 Q 

MOV 

AM 


RLC 


003036Q 

CMA 



RRC 


JNC 


301 2Q 

MOV LI 

274Q 

003045Q 

MOV 

CM 


INR L 


MOV 

BM 


MOV LI 

277Q 

003052Q 

MOV 

EM 


CALL 

2640Q 

JMP 


301 2Q 

RET 


003062Q 

LX I 

H 

24300Q 

MOV MC 


I NX 

H 


MOV MB 


003070Q 

INR 

L 


MOV ME 


I NX 

H 


MOV MD 


003074Q 

JMP 


3167Q 

LX I H 

24300Q 

MOV 

CM 


I NR L 


003104Q 

MOV 

BM 


CALL 

2366Q 

LX I 

H 

24304Q 

MOV MA 


003114Q 

SUB 

I 

201 Q 

ADD I 

377Q 

SBC 

A 


MOV CA 


003122Q 

MOV 

AM 


RLC 


ANA 

C 


RRC 


003126Q 

JC 


3077Q 

MOV AM 


RET 



LX I H 

24302Q 

003136Q 

MOV 

CM 


INR L 


MOV 

BM 


CALL 

2524Q 

0031440 

LX I 

H 

24305Q 

MOV MA 


SUB 

I 

201 Q 

ADD I 

377Q 

003154Q 

SBC 

A 


MOV CA 


MOV 

AM 


RLC 


003160Q 

ANA 

C 


RRC 


JC 


3133Q 

MOV AM 


003166Q 

RET 



LX I H 

23153Q 

MOV 

MI 

377Q 

I NR L 


003175Q 

MOV 

Ml 

377Q 

CALL 

3077Q 

LX I 

H 

22743Q 

MOV MA 


003206Q 

CALL 

31 33Q 

LX I H 

22743Q 

SUB 

M 


JNZ 

3234Q 

003220Q 

LX I 

H 

24304Q 

MOV AM 


SUB 

I 

201 Q 

JNZ 

31 77Q 

003231Q 

MOV 

A! 

377Q 

RET 


XRA 

A 


RET 


003236Q 

LX! 

H 

24306Q 

MOV MC 


I NX 

H 


MOV MB 


003244Q 

DCR 

L 


MOV CM 


INR 

L 


MOV BM 


003250Q 

MOV 

CB 


MOV AC 


SUB 

I 

OQ 

JNZ 

3262Q 

003257Q 

MOV 

AI 

377Q 

RET 


LX I 

H 

23153Q 

MOV MI 

377Q 

003267Q 

LX! 

H 

24306Q 

MOV AM 


INR 

L 


MOV BM 


003275Q 

ANA 

I 

360Q 

MOV CA 


MOV 

AB 


ANA I 

377Q 

003303Q 

MOV 

BA 


CALL 

2366Q 

LX I 

H 

2431 IQ 

MOV MA 


003313Q 

SUB 

I 

201 Q 

JZ 

3331 Q 

MOV 

AM 


RLC 


003322Q 

CMA 



RRC 


JNC 


3267Q 

XRA A 


003330Q 

RET 



MOV AI 

377Q 

RET 



LX I H 

24312Q 

003337Q 

MOV 

MC 


I NX H 


MOV 

MB 


LX I H 

23153Q 

003345Q 

MOV 

MI 

377Q 

LX I H 

24312Q 

MOV 

AM 


INR L 


003354Q 

MOV 

BM 


ANA I 

360Q 

MOV 

CA 


MOV AB 


003361Q 

ANA 

I 

377Q 

MOV BA 


CALL 

2366Q 

LX I H 

24315Q 

003372Q 

MOV 

MA 


SUB I 

201 Q 

ADD 

I 

377Q 

SBC A 



Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 33 


180 




003400Q 

MOV CA 


PUSH B 


MOV Cl 

1 3Q 

MOV El 

OQ 

003406Q 

MOV Dl 

OQ 

CALL 

462Q 

CMA 


POP D 


003415Q 

ANA E 


RRC 


JNC 

3470Q 

LX I H 

24315Q 

003425Q 

MOV AM 


RLC 


CMA 


RRC 


003431Q 

JNC 

3347Q 

LX I H 

22744Q 

MOV AM 


RRC 


003441Q 

JNC 

3456Q 

LX I H 

24315Q 

MOV CM 


CALL 

5260 

003453Q 

JMP 

3465Q 

LX I H 

24315Q 

MOV CM 


CALL 

573Q 

003465Q 

JMP 

3347Q 

RET 


MOV Cl 

2Q 

MOV BI 

OQ 

003475Q 

CALL 

1073Q 

CALL 

1 223Q 

RRC 


JNC 

3527Q 

003507Q 

CALL 

1304Q 

MOV LI 

11 2Q 

MOV MA 


MOV Cl 

2Q 

003517Q 

MOV BI 

OQ 

CALL 

1073Q 

JMP 

3500Q 

RET 


003530Q 

LX I H 

24316Q 

MOV MC 


I NX H 


MOV MB 


003P36Q 

CALL 

3471 Q 

MOV LI 

153Q 

MOV MI 

377Q 

LX I H 

24316Q 

003550Q 

MOV CM 


INR L 


MOV BM 


CALL 

23660 

003556Q 

LX I H 

243210 

MOV MA 


SUB I 

201 Q 

JZ 

3605Q 

003567Q 

MOV AM 


RLC 


CMA 


RRC 


003573Q 

JNC 

35450 

MOV CM 


CALL 

1243Q 

JMP 

35f»5Q 

003G05Q 

RET 


LX I H 

24322Q 

MOV MC 


I NX H 


003613Q 

MOV MB 


JMP 

4022Q 

LX I H 

23154Q 

MOV MI 

377Q 

003624Q 

LX I H 

243240 

MOV CM 


INR L 


MOV BM 


003632Q 

LX I H 

23156Q 

MOV MC 


I NX H 


MOV MB 


003640Q 

MOV Cl 

OQ 

MOV BI 

00 

CALL 

2366Q 

LX I H 

24335Q 

003652Q 

MOV MA 


MOV CA 


PUSH B 


MOV LI 

322Q 

003657Q 

MOV CM 


INR L 


MOV BM 


CALL 

2524Q 

003665Q 

POP D 


SUB E 


JNZ 

3746Q 

LX I H 

24335Q 

003675Q 

MOV AM 


SUB I 

201 Q 

JNZ 

37060 

MOV A1 

377Q 

003705Q 

RET 


CALL 

1 223Q 

RRC 


JNC 

3640Q 

003715Q 

LX I H 

24330Q 

MOV CM 


I NR L 


MOV BM 


003723Q 

MOV LI 

326Q 

MOV MC 


I NX H 


MOV MB 


003730Q 

CALL 

1304Q 

MOV EA 


MOV Cl 

OQ 

MOV BI 

OQ 

003740Q 

CALL 

2640Q 

JMP 

36400 

LX I H 

24335Q 

MOV AM 


003752Q 

SUB I 

201 Q 

JZ 

4020Q 

MOV LI 

324Q 

MOV CM 


003762Q 

INR L 


MOV BM 


LX I H 

231560 

MOV MC 


003770Q 

1 NX H 


MOV MB 


MOV Cl 

OQ 

MOV B1 

OQ 

003776Q 

CALL 

2366Q 

LX I H 

23112Q 

MOV MA 


MOV LI 

1 56Q 

004007Q 

MOV CM 


INR L 


MOV BM 


LX 1 H 

24324Q 

0040150 

MOV MC 


I NX H 


MOV MB 


XRA A 


004021Q 

RET 


LX I H 

230720 

MOV AM 


I NR L 


0040270 

MOV BM 


SUB 1 

OQ 

MOV CA 


MOV AB 


004034Q 

SBC I 

OQ 

ORA C 


JNZ 

40550 

LX I H 

24330Q 

004045Q 

MOV Ml 

2Q 

I NX H 


MOV Ml 

OQ 

JMP 

4075Q 

004055Q 

LHLD 

23072Q 

1 NX H 


SHLD 

24330Q 

CALL 

347 IQ 

004067Q 

MOV LI 

102Q 

MOV CM 


CALL 

1243Q 

CALL 

1 444Q 

004100Q 

LX 1 H 

242100 

MOV MA 


I NX H 


MOV MB 


004106Q 

MOV CA 


MOV LC 


MOV HB 


I NX H 


004112Q 

SHLD 

24324Q 

LX I H 

231550 

MOV MI 

377Q 

LX I H 

24330Q 

0041250 

MOV CM 


INR L 


MOV BM 


MOV LI 

326Q 

004132Q 

MOV MC 


I NX H 


MOV MB 


LHLD 

24326Q 

004140Q 

DCX H 


SHLD 

243260 

XCHG 


MOV AE 


004146Q 

SUB 1 

00 

MOV EA 


MOV AD 


SBC I 

OQ 

0041540 

ORA E 


ADD I 

377Q 

SBC A 


LX 1 H 

22742Q 

0041630 

MOV MA 


CALL 

631 Q 

CMA 


LX I H 

22742Q 

004173Q 

ANA M 


RRC 


JNC 

4320Q 

LX I H 

24332Q 

0042030 

MOV Ml 

00 

I NX H 


MOV Ml 

00 

MOV A1 

21 OQ 

004212Q 

MOV B1 

230 

LX I H 

24332Q 

SUB M 


INR L 


004221Q 

MOV CA 


MOV AB 


SBC M 


JC 

41350 

0042270 

CALL 

1223Q 

RRC 


JNC 

4300Q 

LX I H 

24330Q 

004241Q 

MOV CM 


INR L 


MOV BM 


MOV LI 

326Q 

004246Q 

MOV MC 


I NX H 


MOV MB 


CALL 

1 304Q 

0042540 

MOV EA 


LX I H 

2421OQ 

MOV CM 


INR L 


004262Q 

MOV BM 


CALL 

2640Q 

CALL 

361 7Q 

RRC 


0042720 

JNC 

43000 

MOV AI 

3770 

RET 


LX I H 

24332Q 

0043030 

MOV CM 


INR L 


MOV BM 


LX I H 

IQ 

00431 IQ 

DAD B 


SHLD 

24332Q 

JMP 

42100 

XRA A 


004321Q 

RET 


LX I H 

24437Q 

MOV MI 

OQ 

MOV AI 

37Q 

0043310 

LX 1 H 

24437Q 

SUB M 


JC 

4364Q 

MOV CM 


004341Q 

MOV BI 

OQ 

DCR H 


MOV LI 

336Q 

DAD B 


004347Q 

DAD B 


MOV MI 

00 

I NX H 


MOV MI 

OQ 

004355Q 

LX I H 

24437Q 

INR M 


JNZ 

4327Q 

RET 


004365Q 

LX I H 

244440 

MOV MC 


I NX H 


MOV MB 


004373Q 

INR L 


MOV Ml 

OQ 

LX I H 

23153Q 

MOV MI 

377Q 

004403Q 

LX I H 

24444Q 

MOV CM 


INR L 


MOV BM 


00441 IQ 

CALL 

2366Q 

LX I H 

24447Q 

MOV MA 


SUB I 

20 IQ 

004422Q 

JZ 

4434Q 

MOV AM 


DCR L 


ADD M 


004430Q 

MOV MA 


JMP 

4403Q 

DCR L 


MOV AM 


004436Q 

ANA I 

37Q 

MOV LI 

370 

MOV MA 


MOV CA 


004444Q 

MOV B1 

00 

DCR H 


MOV LI 

3360 

DAD B 


004452Q 

DAD B 


MOV AM 


I NX H 


MOV BM 


004456Q 

LX 1 H 

24440Q 

MOV MA 


I NX H 


MOV MB 


004464Q 

MOV CB 


MOV AC 


SUB I 

OQ 

JNZ 

4475Q 

004473Q 

XRA A 


RET 


MOV LI 

37Q 

MOV CM 


004500Q 

MOV B1 

OQ 

DCR H 


MOV LI 

336Q 

DAD B 


004506Q 

DAD B 


SHLD 

24442Q 

LX I B 

60 

LHLD 

244400 

004520Q 

DAD B 


XCHG 


LX I H 

24444Q 

MOV CM 


004526Q 

INR L 


MOV BM 


CALL 

30620 

CMA 


004534Q 

RRC 


JNC 

4577Q 

LX! H 

244400 

MOV CM 


004544Q 

INR L 


MOV BM 


INR L 


MOV MC 


004550Q 

I NX H 


MOV MB 


LHLD 

24440Q 

MOV AM 


004556Q 

I NX H 


MOV BM 


LX I H 

24440Q 

MOV MA 


004564Q 

I NX H 


MOV MB 


MOV CB 


MOV AC 


004570Q 

SUB I 

OQ 

JNZ 

451 2Q 

XRA A 


RET 


004577Q 

MOV At 

3770 

RET 


LX I B 

60 

LHLD 

24440Q 

004610Q 

DAD B 


MOV AM 


I NX H 


MOV BM 


004614Q 

MOV CA 


CALL 

2052Q 

LX I B 

4Q 

LHLD 

24440Q 


Number 24 

181 


Page 34 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 



004626Q 

DAD 

B 


MOV AM 


1 NX H 


MOV BM 


004632Q 

MOV 

CA 


CALL 

2052Q 

LHLD 

24440Q 

MOV AM 


004642Q 

1 NX 

H 


MOV BM 


LHLD 

24442Q 

MOV MA 


004650Q 

I NX 

H 


MOV MB 


LX I H 

244400 

MOV CM 


004656Q 

I NR 

L 


MOV BM 


CALL 

1 405Q 

RET 


004664Q 

LX 1 

H 

244500 

MOV MC 


I NX H 


MOV MB 


004672Q 

CALL 

1444Q 

LX 1 H 

24440Q 

MOV MA 


1 NX H 


004702Q 

MOV 

MB 


MOV LI 

370 

MOV CM 


MOV BI 

OQ 

004710Q 

DCR 

H 


MOV LI 

336Q 

DAD B 


DAD B 


0047150 

MOV 

AM 


1 NX H 


MOV BM 


LHLD 

24440Q 

004723Q 

MOV 

MA 


I NX H 


MOV MB 


LX I H 

24437Q 

004731Q 

MOV 

CM 


MOV B1 

OQ 

DCR H 


MOV LI 

336Q 

004737Q 

DAD 

B 


DAD B 


XCHG 


LX I H 

244400 

004745Q 

MOV 

CM 


INR L 


MOV BM 


MOV AC 


004751Q 

STAX D 


1 NX D 


MOV AB 


STAX D 


004755Q 

LX I 

B 

6Q 

LHLD 

24440Q 

DAD B 


MOV MI 

00 

004766Q 

I NX 

H 


MOV Ml 

OQ 

LX I B 

60 

LHLD 

24440Q 

004777Q 

DAD 

B 


XCHG 


LX I H 

244500 

MOV CM 


005005Q 

INR 

L 


MOV BM 


CALL 

2767Q 

LX I B 

4Q 

005015Q 

LHLD 

24440Q 

DAD B 


MOV Ml 

OQ 

I NX H 


005024Q 

MOV 

Ml 

OQ 

RET 


LX I H 

24452Q 

MOV MC 


005033Q 

I NX 

H 


MOV MB 


LX I B 

4Q 

LHLD 

24440Q 

005043Q 

DAD 

B 


MOV AM 


I NX H 


MOV BM 


005047Q 

MOV 

CA 


CALL 

2052Q 

LX I B 

4Q 

LHLD 

24440Q 

005061Q 

DAD 

B 


XCHG 


LX I H 

24452Q 

MOV CM 


005067Q 

INR 

L 


MOV BM 


MOV AC 


STAX D 


005073Q 

I NX 

D 


MOV AB 


STAX D 


LHLD 

24440Q 

005101Q 

I NX 

H 


I NX H 


PUSH H 


LHLD 

24452Q 

005107Q 

I NX 

H 


XCHG 


POP H 


MOV ME 


005113Q 

I NX 

H 


MOV MD 


RET 


JMP 

5136Q 

005121Q 

100Q 

1 73Q 160Q 

163Q 174Q 100Q 

1 73Q 162Q 

163Q 174Q 

056Q 175Q 175Q 

005136Q 

LX I 

H 

23155Q 

MOV MI 

377Q 

CALL 

1444Q 

LX 1 H 

2311OQ 

005151Q 

MOV 

MA 


I NX H 


MOV MB 


MOV El 

1 000 

005156Q 

MOV 

CA 


CALL 

2640Q 

MOV Cl 

00 

MOV BI 

OQ 

005166Q 

MOV 

El 

1 51 Q 

CALL 

26400 

MOV Cl 

OQ 

MOV BI 

OQ 

005177Q 

MOV 

El 

155Q 

CALL 

26400 

LX I H 

23110Q 

MOV CM 


00521OQ 

I NR 

L 


MOV BM 


CALL 

4365Q 

LX I H 

23112Q 

005220Q 

MOV 

MA 


MOV LI 

11 OQ 

MOV CM 


INR L 


005225Q 

MOV 

BM 


CALL 

46640 

LX I H 

23110Q 

MOV CM 


005235Q 

INR 

L 


MOV BM 


CALL 

1405Q 

LX I H 

23155Q 

005245Q 

MOV 

MI 

377Q 

CALL 

1 4440 

LX I H 

2311OQ 

MOV MA 


005256Q 

I NX 

H 


MOV MB 


MOV LI 

1 130 

MOV MI 

OQ 

005264Q 

MOV 

A I 

14Q 

LX 1 H 

23113Q 

SUB M 


JC 

5326Q 

005275Q 

MOV 

CM 


MOV Bl 

OQ 

LX I H 

51 21 Q 

DAD B 


0053040 

MOV 

AM 


MOV EA 


LX I H 

2311OQ 

MOV CM 


005312Q 

I NR 

L 


MOV BM 


CALL 

2640Q 

LX I H 

23113Q 

005322Q 

I NR 

M 


JNZ 

5264Q 

MOV LI 

1 1 OQ 

MOV CM 


005331Q 

I NR 

L 


MOV BM 


CALL 

5027Q 

RET 


005337Q 

LX I 

H 

24162Q 

MOV CM 


MOV Bl 

OQ 

LX I H 

23164Q 

005350Q 

DAD 

B 


DAD B 


MOV AM 


I NX H 


005354Q 

MOV 

BM 


LX I H 

244540 

MOV MA 


I NX H 


005362Q 

MOV 

MB 


DCR H 


MOV LI 

1 62Q 

INR M 


005367Q 

I NR 

H 


MOV LI 

54Q 

MOV AM 


INR L 


005374Q 

MOV 

BM 


RET 


LX 1 H 

24162Q 

INR M 


005402Q 

MOV 

CM 


MOV BI 

OQ 

LX I H 

23164Q 

DAD B 


00541 IQ 

DAD 

B 


MOV AM 


I NX H 


MOV BM 


005415Q 

RET 



CALL 

5337Q 

DCR H 


MOV LI 

21 OQ 

005424Q 

MOV 

MA 


1 NX H 


MOV MB 


RRC 


005430Q 

JNC 


54450 

CALL 

476Q 

LX 1 H 

24163Q 

MOV CM 


005442Q 

DCR 

L 


MOV MC 


RET 


DCR L 


005446Q 

MOV 

CM 


INR L 


MOV BM 


CALL 

3334Q 

005454Q 

MOV 

Cl 

1340 

CALL 

5260 

JMP 

54160 

RET 


005465Q 

LX I 

H 

24203Q 

MOV AM 


ADD A 


ORA 1 

IQ 

005474Q 

MOV 

MA 


LX 1 H 

22744Q 

MOV MI 

3770 

RET 


005503Q 

LX I 

H 

24203Q 

MOV AM 


ORA A 


RAR 


00551 IQ 

MOV 

MA 


RET 


LX I B 

440Q 

CALL 

4365Q 

005521Q 

CMA 



RRC 


JNC 

5534Q 

LX I B 

440Q 

005531Q 

CALL 

46640 

LX I H 

23155Q 

MOV MI 

377Q 

CALL 

1444Q 

005544Q 

LX I 

H 

242100 

MOV MA 


I NX H 


MOV MB 


005552Q 

LX I 

H 

22740Q 

MOV MA 


INR L 


MOV MB 


005560Q 

CALL 

61 7Q 

LX I H 

244560 

MOV MA 


MOV EA 


005570Q 

LX I 

H 

22740Q 

MOV CM 


INR L 


MOV BM 


005576Q 

CALL 

2640Q 

LX I H 

242100 

MOV CM 


INR L 


005606Q 

MOV 

BM 


CALL 

5027Q 

LX 1 H 

24456Q 

MOV AM 


005616Q 

SUB 

I 

33Q 

RNZ 


JMP 

56360 



0056240 

0400 124Q 040Q 

116Q 040Q 

11 IQ 072Q 040Q 

0400 044Q 



005636Q 

LX I 

B 

56240 

CALL 

6430 

CALL 

61 7Q 

LX I H 

244560 

005652Q 

MOV 

MA 


SUB 1 

164Q 

JNZ 

5666Q 

CALL 

54650 

005663Q 

JMP 


57160 

MOV AM 


SUB I 

156Q 

JNZ 

5702Q 

0056740 

CALL 

5503Q 

JMP 

571 6Q 

MOV AM 


SUB I 

1 51 Q 

005705Q 

JNZ 


57160 

LX I SP 

22712Q 

JMP 

403Q 

CALL 

476Q 

005721Q 

RET 



JMP 

57330 





005725Q 

100Q 173Q 100Q 

1 51Q 155Q 

1 75Q 





005733Q 

LX I 

H 

24170Q 

MOV CM 


INR L 


MOV BM 


005741Q 

CALL 

2052Q 

CALL 

1 444Q 

LX I H 

24170Q 

MOV MA 


005753Q 

I NX 

H 


MOV MB 


MOV LI 

221 Q 

MOV AM 


005760Q 

RRC 



JNC 

6043Q 

LX I H 

23155Q 

MOV MI 

377Q 

005771 Q 

LX I 

H 

24457Q 

MOV MI 

OQ 

MOV AI 

5Q 

LX 1 H 

24457Q 

006003Q 

SUB 

M 


JC 

6064Q 

MOV CM 


MOV Bl 

OQ 

006012Q 

LX I 

H 

5725Q 

DAD B 


MOV AM 


MOV EA 


006020Q 

LX I 

H 

24170Q 

MOV CM 


INR L 


MOV BM 


006026Q 

CALL 

2640Q 

LX I H 

244570 

INR M 


JNZ 

5776Q 

006040Q 

JMP 


6064Q 

MOV LI 

21 00 

MOV CM 


INR L 


006047Q 

MOV 

BM 


MOV LI 

1700 

MOV EM 


INR L 



Number 24 

182 


Or. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 35 



006054Q 

MOV DM 


CALL 

2767Q 

MOV LI 

221 Q 

MOV MI 

377Q 

006064Q 

LX I B 

2Q 

LHLD 

24170Q 

DAD B 


SHLD 

24172Q 

006076Q 

LX I H 

24162Q 

MOV Ml 

OQ 

CALL 

5376Q 

LX I H 

24206Q 

00611 IQ 

MOV MA 


I NX H 


MOV MB 


CMA 


006115Q 

RRC 


JNC 

6133Q 

DCR L 


MOV CM 


006123Q 

I NR L 


MOV BM 


CALL 

2052Q 

JMP 

61 03Q 

006133Q 

MOV LI 

1 62Q 

MOV MI 

OQ 

RET 


LX I H 

24170Q 

006143Q 

MOV CM 


INR L 


MOV BM 


LX I H 

2311OQ 

006151Q 

MOV MC 


I NX H 


MOV MB 


LHLD 

24170Q 

006157Q 

MOV AM 


1 NX H 


MOV BM 


LX I H 

24170Q 

006165Q 

MOV MA 


I NX H 


MOV MB 


LX I H 

2311OQ 

006173Q 

MOV CM 


INR L 


MOV BM 


CALL 

1 405Q 

006201Q 

LX 1 B 

2Q 

LHLD 

24170Q 

DAD B 


SHLD 

24172Q 

006213Q 

RET 


LX I H 

24460Q 

MOV MC 


JMP 

6271 Q 

006223Q 

LX I H 

24172Q 

MOV AM 


ANA I 

1 7Q 

SUB I 

OQ 

006233Q 

JNZ 

6264Q 

CALL 

6140Q 

LX 1 H 

24170Q 

MOV CM 


006245Q 

INR L 


MOV BM 


MOV CB 


MOV AC 


006251Q 

SUB I 

OQ 

JNZ 

6264Q 

LX I SP 

22712Q 

JMP 

403Q 

006264Q 

LHLD 

24172Q 

MOV AM 


RET 


CALL 

6223Q 

006274Q 

LX I H 

24461Q 

MOV MA 


RLC 


RRC 


006302Q 

JNC 

631 7Q 

LHLD 

24172Q 

I NX H 


SHLD 

24172Q 

006314Q 

JMP 

6271 Q 

DCR L 


MOV AM 


RRC 


006322Q 

JNC 

6336Q 

LHLD 

24172Q 

MOV MI 

200Q 

I NX H 


006333Q 

SHLD 

24172Q 

LX I H 

24461 Q 

MOV AM 


RET 


006343Q 

LX 1 H 

24464Q 

MOV MC 


DCR H 


MOV LI 

1 62Q 

006352Q 

INR M 


MOV CM 


MOV B1 

OQ 

LX I H 

23164Q 

006361Q 

DAD B 


DAD B 


XCHQ 


LX I H 

22736Q 

006367Q 

MOV ME 


INR L 


MOV MD 


CALL 

1444Q 

006375Q 

LX I H 

24464Q 

ORA M 


MOV CA 


MOV AB 


006403Q 

ORA I 

OQ 

LHLD 

22736Q 

MOV MC 


1 NX H 


006412Q 

MOV MA 


LX I H 

24164Q 

MOV MC 


I NX H 


006420Q 

MOV MA 


DCR L 


MOV AM 


I NR L 


006424Q 

MOV BM 


ANA I 

360Q 

MOV CA 


MOV AB 


006431Q 

ANA I 

377Q 

MOV BA 


LX I D 

2Q 

MOV LC 


006440Q 

MOV HB 


DAD D 


SHLD 

24164Q 

LX I H 

24166Q 

006450Q 

MOV MI 

OQ 

MOV A1 

376Q 

SUB I 

4Q 

MOV LI 

1 62Q 

006460Q 

SUB M 


JNZ 

6526Q 

JMP 

651 3Q 



006467Q 

1 1 6Q 

123Q 040Q 

123Q 124Q 101Q 

1 03Q 113Q 

040Q 117Q 

126Q 105Q 122Q 

006505Q 

1 1 4Q 

1 17Q 127Q 

040Q 040Q 044Q 





006513Q 

MOV Cl 

1 IQ 

LX I D 

6467Q 

CALL 

446Q 

JMP 

5Q 

006526Q 

RET 


LX I H 

24465Q 

MOV MC 


DCR H 


006534Q 

MOV LI 

1 66Q 

MOV AM 


RRC 


JNC 

6612Q 

006543Q 

MOV LI 

1 62Q 

MOV CM 


MOV BI 

OQ 

LX I H 

23164Q 

006553Q 

DAD B 


DAD B 


MOV AM 


I NX H 


006557Q 

MOV BM 


ANA I 

360Q 

MOV CA 


MOV AB 


006564Q 

ANA I 

377Q 

MOV EC 


MOV DA 


LX I H 

24465Q 

006573Q 

MOV CM 


CALL 

2167Q 

MOV LI 

1 64Q 

MOV MA 


006602Q 

I NX H 


MOV MB 


INR L 


MOV MI 

OQ 

006607Q 

JMP 

6712Q 

INR H 


MOV LI 

65Q 

MOV CM 


006616Q 

LHLD 

24164Q 

MOV MC 


I NX H 


SHLD 

24164Q 

006626Q 

XCHG 


MOV AE 


ANA I 

17Q 

SUB 1 

OQ 

006634Q 

JNZ 

6712Q 

LX I H 

24164Q 

MOV AM 


INR L 


006644Q 

MOV BM 


SUB I 

20Q 

MOV CA 


MOV AB 


006651Q 

SBC 1 

OQ 

INR H 


MOV LI 

66Q 

MOV MC 


006657Q 

I NX H 


MOV MA 


CALL 

1 444Q 

LHLD 

24466Q 

006667Q 

MOV MA 


I NX H 


MOV MB 


LX I H 

24164Q 

006675Q 

MOV MA 


I NX H 


MOV MB 


LX I B 

2Q 

006703Q 

LHLD 

24164Q 

DAD B 


SHLD 

24164Q 

RET 


006713Q 

LX I H 

24471Q 

MOV Ml 

OQ 

INR L 


MOV MI 

377Q 

006723Q 

MOV Cl 

377Q 

CALL 

621 4Q 

LX I H 

24473Q 

MOV MA 


006734Q 

SUB I 

1 73Q 

JNZ 

6760Q 

DCR L 


MOV AM 


006743Q 

RRC 


JNC 

6751 Q 

DCR L 


INR M 


006751Q 

MOV LI 

72Q 

MOV MI 

377Q 

JMP 

701 IQ 

MOV AM 


006761Q 

SUB I 

1 75Q 

JNZ 

701 IQ 

DCR L 


MOV AM 


006770Q 

RRC 


JNC 

7001 Q 

MOV MI 

OQ 

JMP 

7003Q 

007001 Q 

DCR L 


DCR M 


MOV LI 

71 Q 

MOV AM 


007006Q 

SUB I 

OQ 

RZ 


MOV LI 

73Q 

MOV CM 


007014Q 

CALL 

6527Q 

JMP 

6723Q 

RET 


MOV Cl 

OQ 

007025Q 

CALL 

621 4Q 

LX I H 

24477Q 

MOV MA 


SUB I 

1 OOQ 

007036Q 

JNZ 

71 26Q 

MOV Cl 

377Q 

CALL 

621 4Q 

LX I H 

23112Q 

007051Q 

MOV MA 


MOV Cl 

OQ 

CALL 

621 4Q 

LX I H 

24477Q 

007062Q 

MOV MA 


SUB I 

1 73Q 

JNZ 

71 1 IQ 

MOV Cl 

377Q 

007072Q 

CALL 

621 4Q 

LX I H 

23112Q 

MOV MA 


MOV Cl 

2Q 

007103Q 

CALL 

6343Q 

JMP 

7165Q 

MOV Cl 

1 OOQ 

CALL 

6527Q 

007116Q 

MOV Cl 

1 OOQ 

CALL 

6527Q 

JMP 

71 65Q 

MOV AM 


007127Q 

SUB I 

1 73Q 

JNZ 

7160Q 

MOV Cl 

377Q 

CALL 

621 4Q 

007141Q 

LX I H 

23112Q 

MOV MA 


MOV AI 

2Q 

ORA I 

4Q 

007151Q 

MOV CA 


CALL 

6343Q 

JMP 

71 65Q 

MOV Cl 

1 OOQ 

007162Q 

CALL 

6527Q 

RET 


LX I H 

24500Q 

MOV MC 


007172Q 

1 NX H 


MOV MB 


MOV LI 

1 1 3Q 

MOV MI 

OQ 

007200Q 

MOV Cl 

OQ 

DCR C 


MOV LI 

1 1 IQ 

MOV MC 


007206Q 

MOV LI 

1 OOQ 

MOV CM 


INR L 


MOV BM 


007213Q 

MOV CB 


MOV AC 


RLC 


RRC 


007217Q 

JNC 

7246Q 

MOV LI 

113Q 

MOV MI 

377Q 

XRA A 


007227Q 

MOV LI 

1 OOQ 

SUB M 


INR L 


MOV CA 


007234Q 

MOV A1 

OQ 

SBC M 


DCR L 


MOV MC 


007241 Q 

I NX H 


MOV MA 


JMP 

7274Q 

DCR L 


007247Q 

MOV AM 


INR L 


MOV BM 


SUB I 

OQ 

007254Q 

MOV CA 


MOV AB 


SBC I 

OQ 

ORA C 


007261Q 

JNZ 

7274Q 

MOV LI 

11 IQ 

MOV MI 

OQ 

MOV LI 

1 03Q 

007272Q 

MOV Ml 

60Q 

XRA A 


LX I H 

24500Q 

SUB M 


007301Q 

INR L 


MOV CA 


MOV AI 

OQ 

SBC M 


007306Q 

JNC 

7466Q 

MOV LI 

11 IQ 

INR M 


MOV CM 


007315Q 

MOV B1 

OQ 

MOV LI 

103Q 

DAD B 


XCHG 



Page 36 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 24 

183 



007323Q 

LX I 

H 

227340 

MOV 

ME 


INR 

L 


MOV 

MD 


007331Q 

MOV 

El 

120 

MOV 

D1 

00 

LX I 

H 

24500Q 

MOV 

CM 


007341Q 

I NR 

L 


MOV 

BM 


JMP 


7423Q 

MOV 

AD 


007347Q 

CMA 



MOV 

DA 


MOV 

AE 


CMA 



0073530 

MOV 

EA 


I NX 

D 


LX I 

H 

00 

MOV 

A 1 

21 Q 

007362Q 

PUSH H 


DAD 

D 


JNC 


73700 

XTHL 


007370Q 

POP 

H 


PUSH A 


MOV 

AC 


RAL 



007374Q 

MOV 

CA 


MOV 

AB 


RAL 



MOV 

BA 


007400Q 

MOV 

AL 


RAL 



MOV 

LA 


MOV 

AH 


007404Q 

RAL 



MOV 

HA 


POP 

A 


DCR 

A 


007410Q 

JNZ 


7362Q 

ORA 

A 


MOV 

AH 


RAR 



007416Q 

MOV 

DA 


MOV 

AL 


RAR 



MOV 

EA 


007422Q 

RET 



CALL 

7346Q 

LX I 

B 

60Q 

XCHG 


007432Q 

DAD 

B 


XCHG 


LHLD 

22734Q 

MOV 

ME 


007440Q 

MOV 

El 

12Q 

MOV 

D1 

00 

LX I 

H 

24500Q 

MOV 

CM 


007450Q 

I NR 

L 


MOV 

BM 


CALL 

7346Q 

LX I 

H 

245000 

007460Q 

MOV 

MC 


1 NX 

H 


MOV 

MB 


JMP 


7274Q 

007466Q 

MOV 

LI 

1 1 30 

MOV 

AM 


RRC 



JNC 


751 OQ 

0074750 

MOV 

LI 

1 1 IQ 

INR 

M 


MOV 

CM 


MOV 

B I 

OQ 

007503Q 

MOV 

LI 

1030 

DAD 

B 


MOV 

MI 

55Q 

CALL 

1 444Q 

007513Q 

LX I 

H 

24210Q 

MOV 

MA 


I NX 

H 


MOV 

MB 


0075210 

LX I 

H 

23155Q 

MOV 

MI 

3770 

LX 1 

H 

245120 

MOV 

MI 

OQ 

007533Q 

LX 1 

H 

2451 IQ 

MOV 

AM 


INR 

L 


SUB 

M 


007541 Q 

JC 


7600Q 

DCR 

L 


MOV 

AM 


1 NR 

L 


007547Q 

SUB 

M 


MOV 

CA 


MOV 

BI 

OQ 

MOV 

LI 

1 03Q 

007555Q 

DAD 

B 


MOV 

AM 


MOV 

EA 


LX I 

H 

2421OQ 

007563Q 

MOV 

CM 


INR 

L 


MOV 

BM 


CALL 

2640Q 

007571Q 

LX I 

H 

24512Q 

INR 

M 


JNZ 


7533Q 

RET 



007601Q 

LX I 

H 

24514Q 

MOV 

MC 


I NX 

H 


MOV 

MB 


007607Q 

I NR 

L 


MOV 

Ml 

OQ 

I NX 

H 


MOV 

Ml 

OQ 

007615Q 

MOV 

LI 

1 22Q 

MOV 

Ml 

OQ 

LX I 

H 

23153Q 

MOV 

Ml 

377Q 

007626Q 

LX I 

H 

24514Q 

MOV 

AM 


INR 

L 


MOV 

BM 


007634Q 

ANA 

I 

360Q 

MOV 

CA 


MOV 

AB 


ANA 

1 

377Q 

007642Q 

MOV 

BA 


CALL 

2366Q 

LX I 

H 

24521 Q 

MOV 

MA 


0076520 

SUB 

I 

201 Q 

JZ 


77550 

MOV 

AM 


SUB 

1 

55Q 

007662Q 

JNZ 


7673Q 

I NR 

L 


MOV 

MI 

377Q 

JMP 


7626Q 

0076730 

MOV 

AM 


SUB 

I 

60Q 

MOV 

MA 


SUB 

1 

1 2Q 

007701Q 

JNC 


77520 

MOV 

Cl 

3Q 

MOV 

LI 

1160 

MOV 

EM 


0077110 

I NR 

L 


MOV 

DM 


MOV 

AE 


ADD 

A 


0077150 

MOV 

EA 


MOV 

AD 


RAL 



MOV 

DA 


007721Q 

DCR 

C 


JNZ 


771 30 

LHLD 

245160 

DAD 

D 


007731Q 

XCH0 


LHLD 

24516Q 

DAD 

D 


XCHG 


007737Q 

LX I 

H 

24521Q 

MOV 

CM 


MOV 

B I 

OQ 

XCHG 


007746Q 

DAD 

B 


SHLD 

24516Q 

JMP 


7626Q 

I NR 

L 


007756Q 

MOV 

AM 


RRC 



JNC 


7777Q 

XRA 

A 


0077640 

MOV 

LI 

1 16Q 

SUB 

M 


I NR 

L 


MOV 

CA 


0077710 

MOV 

AI 

OQ 

SBC 

M 


MOV 

BA 


MOV 

AC 


007776Q 

RET 



MOV 

LI 

1160 

MOV 

AM 


I NR 

L 


010003Q 

MOV 

BM 


RET 



LX I 

H 

24523Q 

MOV 

MC 


01001 IQ 

MOV 

A 1 

71 Q 

SUB 

M 


JC 


10023Q 

MOV 

AM 


010020Q 

SUB 

I 

60Q 

RET 



MOV 

AM 


SUB 

I 

1 07Q 

010026Q 

JNC 


10035Q 

MOV 

AM 


SUB 

1 

67Q 

RET 



010035Q 

MOV 

AM 


SUB 

I 

127Q 

RET 



LX I 

H 

24524Q 

010044Q 

MOV 

MC 


MOV 

AM 


SUB 

1 

1 2Q 

JNC 


10057Q 

010053Q 

MOV 

AM 


ADD 

1 

60Q 

RET 



MOV 

AM 


010060Q 

ADD 

1 

1 27Q 

RET 



LX I 

H 

24525Q 

MOV 

MI 

IQ 

010070Q 

CALL 

5376Q 

LX I 

H 

24206Q 

MOV 

MA 


I NX 

H 


010100Q 

MOV 

MB 


CMA 



RRC 



JNC 


10115Q 

010106Q 

I NR 

H 


MOV 

LI 

1250 

INR 

M 


JMP 


10070Q 

010115Q 

MOV 

LI 

1 63Q 

MOV 

CM 


DCR 

L 


MOV 

MC 


010122Q 

1 NR 

H 


MOV 

LI 

125Q 

MOV 

AM 


RET 



010127Q 

JMP 


10332Q 

LX I 

H 

23154Q 

MOV 

MI 

377Q 

LX I 

H 

24206Q 

010142Q 

MOV 

CM 


INR 

L 


MOV 

BM 


CALL 

2524Q 

010150Q 

LX I 

H 

24527Q 

MOV 

MA 


RLC 



RRC 



010156Q 

JNC 


10172Q 

MOV 

AM 


SUB 

I 

201 Q 

JNZ 


10137Q 

0101670 

MOV 

A 1 

377Q 

RET 



MOV 

Cl 

OQ 

MOV 

B I 

OQ 

010176Q 

CALL 

23660 

LX I 

H 

24526Q 

MOV 

MA 


RLC 



010206Q 

RRC 



JNC 


10222Q 

MOV 

AM 


SUB 

I 

200Q 

010215Q 

JZ 


10172Q 

XRA 

A 


RET 



MOV 

AM 


010223Q 

I NR 

L 


SUB 

M 


JZ 


10137Q 

XRA 

A 


0102310 

RET 



RET 



LX I 

H 

24530Q 

MOV 

CM 


010237Q 

I NR 

L 


MOV 

BM 


LX I 

H 

23156Q 

MOV 

MC 


010245Q 

1 NX 

H 


MOV 

MB 


MOV 

Cl 

OQ 

MOV 

BI 

OQ 

010253Q 

CALL 

2366Q 

LX I 

H 

231120 

MOV 

MA 


LX 1 

H 

23156Q 

0102650 

MOV 

CM 


I NR 

L 


MOV 

BM 


LX I 

H 

24530Q 

010273Q 

MOV 

MC 


I NX 

H 


MOV 

MB 


MOV 

Cl 

OQ 

010300Q 

MOV 

B1 

00 

CALL 

2366Q 

LX 1 

H 

24526Q 

MOV 

MA 


01031 IQ 

RLC 



RRC 



JNC 


10326Q 

MOV 

AM 


010317Q 

SUB 

I 

201 Q 

JNZ 


1 0262Q 

XRA 

A 


RET 



010326Q 

MOV 

AI 

377Q 

RET 



RET 



LX I 

H 

24174Q 

010335Q 

MOV 

CM 


I NR 

L 


MOV 

BM 


1 NR 

H 


010341Q 

MOV 

LI 

1 30Q 

MOV 

MC 


I NX 

H 


MOV 

MB 


010346Q 

DCR 

H 


MOV 

LI 

206Q 

MOV 

CM 


INR 

L 


010353Q 

MOV 

BM 


CALL 

3236Q 

RRC 



JNC 


1 0365Q 

010363Q 

XRA 

A 


RET 



LX I 

H 

24530Q 

MOV 

CM 


010371Q 

I NR 

L 


MOV 

BM 


LX I 

H 

23156Q 

MOV 

MC 


010377Q 

I NX 

H 


MOV 

MB 


CALL 

10132Q 

RRC 



010405Q 

JNC 


10443Q 

LX I 

H 

24530Q 

MOV 

CM 


I NR 

L 


010415Q 

MOV 

BM 


DCR 

H 


MOV 

LI 

1 76Q 

MOV 

MC 


010422Q 

I NX 

H 


MOV 

MB 


LX I 

H 

23156Q 

MOV 

CM 


010430Q 

I NR 

L 


MOV 

BM 


LX I 

H 

24200Q 

MOV 

MC 


010436Q 

I NX 

H 


MOV 

MB 


MOV 

AI 

377Q 

RET 



010443Q 

LX I 

H 

24526Q 

MOV 

AM 


SUB 

I 

201 Q 

JNZ 


10456Q 

010454Q 

XRA 

A 


RET 



CALL 

1 02330 

CMA 




Number 24 Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 

184 


Page 37 



010462Q 

RRC 


JNC 


10365Q 

XRA A 


RET 



010470Q 

RET 


CALL 

5376Q 

LX I H 

24206Q 

MOV 

MA 


010500Q 

I NX H 


MOV 

MB 


CMA 


RRC 



010504Q 

JNC 

10622Q 

DCR 

L 


MOV CM 


I NR 

L 


01 0512Q 

MOV BM 


CALL 

4365Q 

CMA 


RRC 



010520Q 

JNC 

10534Q 

LX I 

H 

24206Q 

MOV CM 


INR 

L 


010530Q 

MOV BM 


CALL 

4664Q 

CALL 

5376Q 

LX I 

H 

24206Q 

010542Q 

MOV MA 


I NX 

H 


MOV MB 


RRC 



010546Q 

JNC 

10561Q 

CALL 

1444Q 

MOV CA 


CALL 

5027Q 

010560Q 

RET 


DCR 

L 


MOV CM 


I NR 

L 


010564Q 

MOV BM 


CALL 

5027Q 

LX I H 

24162Q 

MOV 

CM 


010574Q 

MOV BI 

OQ 

LX I 

H 

23164Q 

DAD B 


DAD 

B 


010603Q 

XCHG 


LX I 

H 

24216Q 

MOV CM 


I NR 

L 


01061 IQ 

MOV BM 


MOV 

AC 


STAX D 


I NX 

D 


010615Q 

MOV AB 


STAX D 


JMP 

10471Q 

RET 



010623Q 

CALL 

5376Q 

LX I 

H 

24206Q 

MOV MA 


I NX 

H 


010633Q 

MOV MB 


CMA 



RRC 


JNC 


11Q50Q 

010641Q 

DCR L 


MOV 

CM 


INR L 


MOV 

BM 


010645Q 

CALL 

4365Q 

CMA 



RRC 


JNC 


10675Q 

010655Q 

LX I H 

24206Q 

MOV 

CM 


INR L 


MOV 

BM 


010663Q 

CALL 

4664Q 

CALL 

1 444Q 

MOV CA 


CALL 

5027Q 

010675Q 

CALL 

5376Q 

LX I 

H 

24206Q 

MOV MA 


I NX 

H 


010705Q 

MOV MB 


RRC 



RC 


LX I 

H 

23153Q 

010713Q 

MOV MI 

377Q 

LX I 

H 

24206Q 

MOV CM 


I NR 

L 


010722Q 

MOV BM 


CALL 

2366Q 

LX I H 

24532Q 

MOV 

MA 


010732Q 

SUB I 

201 Q 

JZ 


10623Q 

LX I B 

4Q 

LHLD 

24440Q 

010745Q 

DAD B 


MOV 

AM 


I NX H 


MOV 

BM 


010751Q 

MOV EA 


MOV 

DB 


LX I H 

24532Q 

MOV 

CM 


010757Q 

CALL 

21 67Q 

LX I 

H 

23160Q 

MOV MA 


I NX 

H 


010767Q 

MOV MB 


DCR 

L 


MOV AM 


I NR 

L 


010773Q 

MOV BM 


ANA 

I 

360Q 

MOV CA 


MOV 

AB 


011000Q 

ANA I 

377Q 

1 NR 

L 


MOV MC 


I NX 

H 


011005Q 

MOV MA 


MOV 

LI 

155Q 

MOV MI 

OQ 

MOV 

Cl 

OQ 

01 1 014Q 

MOV BI 

OQ 

CALL 

2366Q 

LX I H 

24532Q 

MOV 

MA 


011025Q 

SUB I 

201 Q 

JZ 


11045Q 

MOV Cl 

OQ 

MOV 

B I 

OQ 

011036Q 

MOV EM 


CALL 

2640Q 

JMP 

11012Q 

JMP 


10623Q 

01 1050Q 

RET 


JMP 


11144Q 

LX I H 

24535Q 

MOV 

MC 


011060Q 

LHLD 

23160Q 

MOV 

MC 


I NX H 


SHLD 

23160Q 

011070Q 

XCHG 


MOV 

AE 


ANA I 

1 7Q 

SUB 

I 

OQ 

01 1076Q 

JNZ 

11143Q 

LX I 

H 

23160Q 

MOV AM 


INR 

L 


011106Q 

MOV BM 


SUB 

I 

20Q 

MOV CA 


MOV 

AB 


01 1113Q 

SBC I 

OQ 

LX I 

H 

24536Q 

MOV MC 


I NX 

H 


011122Q 

MOV MA 


LHLD 

24536Q 

MOV AM 


I NX 

H 


011130Q 

MOV BM 


MOV 

CA 


LX I D 

2Q 

MOV 

LC 


011136Q 

MOV HB 


DAD 

D 


SHLD 

23160Q 

RET 



011144Q 

CALL 

5376Q 

MOV 

CA 


CALL 

4365Q 

CMA 



011154Q 

RRC 


RC 



MOV Cl 

OQ 

DCR 

C 


011161Q 

LX I H 

24533Q 

MOV 

MC 


CALL 

5376Q 

LX I 

H 

24206Q 

011173Q 

MOV MA 


I NX 

H 


MOV MB 


CMA 



011177Q 

RRC 


JNC 


11417Q 

INR H 


MOV 

LI 

1 33Q 

011206Q 

I NR M 


LX 1 

B 

4Q 

LHLD 

24440Q 

DAD 

B 


011216Q 

MOV AM 


I NX 

H 


MOV BM 


MOV 

CA 


011222Q 

MOV LC 


MOV 

HB 


I NX H 


SHLD 

24174Q 

011230Q 

CALL 

10127Q 

RRC 



JNC 

11165Q 

LX I 

H 

24176Q 

011242Q 

MOV CM 


INR 

L 


MOV BM 


LX I 

H 

23156Q 

011250Q 

MOV MC 


I NX 

H 


MOV MB 


MOV 

Cl 

OQ 

011255Q 

MOV BI 

OQ 

CALL 

2366Q 

LX I H 

23112Q 

MOV 

MA 


011266Q 

MOV LI 

156Q 

MOV 

CM 


INR L 


MOV 

BM 


011273Q 

I NR L 


MOV 

MC 


I NX H 


MOV 

MB 


011277Q 

DCR L 


MOV 

AM 


INR L 


MOV 

BM 


011303Q 

LX 1 H 

24200Q 

SUB 

M 


INR L 


MOV 

CA 


01131 IQ 

MOV AB 


SBC 

M 


ORA C 


ADD 

I 

377Q 

011316Q 

SBC A 


INR 

H 


MOV LI 

1 34Q 

MOV 

MA 


011323Q 

DCR L 


MOV 

AM 


ORA I 

300Q 

MOV 

CA 


011330Q 

CALL 

11034Q 

LX I 

H 

24534Q 

MOV AM 


RRC 



011340Q 

JNC 

1 1401Q 

LX I 

H 

23160Q 

MOV AM 


I NR 

L 


011350Q 

MOV BM 


LX I 

H 

24200Q 

SUB M 


I NR 

L 


011356Q 

MOV CA 


MOV 

AB 


SBC M 


ORA 

C 


011362Q 

ADD I 

377Q 

SBC 

A 


INR H 


MOV 

LI 

1 34Q 

011370Q 

MOV MA 


MOV 

Cl 

200Q 

CALL 

1 1054Q 

JMP 


11333Q 

011401Q 

DCR H 


MOV 

LI 

200Q 

MOV CM 


1 NR 

L 


011406Q 

MOV BM 


MOV 

LI 

1740 

MOV MC 


I NX 

H 


011413Q 

MOV MB 


JMP 


1 1230Q 

RET 


JMP 


1 1 631Q 

011423Q 

LX I H 

24544Q 

MOV 

AM 


INR L 


MOV 

BM 


011431Q 

SUB I 

OQ 

MOV 

CA 


MOV AB 


SBC 

I 

OQ 

011437Q 

ORA C 


JNZ 


1 1445Q 

XRA A 


RET 



011445Q 

MOV Cl 

OQ 

MOV 

BI 

OQ 

CALL 

2366Q 

LX I 

H 

24556Q 

011457Q 

MOV MA 


SUB 

I 

201 Q 

JZ 

1 1470Q 

MOV 

AI 

377Q 

011467Q 

RET 


XRA 

A 


RET 


LX I 

H 

24560Q 

011475Q 

MOV MI 

OQ 

I NX 

H 


MOV MI 

OQ 

LX I 

H 

23153Q 

011505Q 

MOV MI 

377Q 

LX I 

B 

4Q 

LHLD 

24440Q 

DAD 

B 


011516Q 

MOV AM 


I NX 

H 


MOV BM 


LX I 

H 

2311OQ 

011524Q 

MOV MA 


I NX 

H 


MOV MB 


LX I 

H 

2311OQ 

011532Q 

MOV CM 


INR 

L 


MOV BM 


CALL 

2366Q 

011540Q 

LX I H 

24556Q 

MOV 

MA 


SUB I 

201 Q 

ADD 

1 

377Q 

011550Q 

SBC A 


MOV 

HI 

46Q 

MOV CA 


MOV 

AM 


011555Q 

INR L 


MOV 

DM 


LX I H 

24546Q 

SUB 

M 


011563Q 

INR L 


MOV 

EA 


MOV AD 


SBC 

M 


011567Q 

ORA E 


ADD 

I 

377Q 

SBC A 


ANA 

C 


011574Q 

RRC 


JNC 


1 1623Q 

MOV LI 

1 56Q 

MOV 

AM 


011603Q 

RLC 


CMA 



RRC 


JNC 


1 1 527Q 

01161 IQ 

LHLD 

24560Q 

I NX 

H 


SHLD 

24560Q 

JMP 


1 1 527Q 

011623Q 

MOV LI 

1 60Q 

MOV 

AM 


INR L 


MOV 

BM 


011630Q 

RET 


LX I 

B 

406Q 

CALL 

4365Q 

CMA 




Page 38 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 24 

185 



Number 24 

186 


011640Q 

RRC 


JNC 


11652Q 

LX I B 

406Q 

CALL 

4664Q 

011652Q 

CALL 

1444Q 

LX I 

H 

24340Q 

MOV MA 


I NX H 


011662Q 

MOV MB 


MOV 

CA 


CALL 

5027Q 

CALL 

3376Q 

011672Q 

LX 1 H 

24204Q 

MOV 

MA 


I NX H 


MOV MB 


011700Q 

CALL 

3376Q 

LX I 

H 

24542Q 

MOV MA 


I NX H 


011710Q 

MOV MB 


CALL 

5376Q 

LX I H 

24212Q 

MOV MA 


011720Q 

I NX H 


MOV 

MB 


CALL 

5376Q 

LX I H 

24214Q 

011730Q 

MOV MA 


I NX 

H 


MOV MB 


MOV LI 

204Q 

011733Q 

MOV CM 


INR 

L 


MOV BM 


CALL 

4365Q 

011743Q 

CMA 


RRC 



RC 


LX I H 

24542Q 

01 1751Q 

MOV AM 


RRC 



JNC 

11775Q 

MOV LI 

146Q 

01 1760Q 

MOV MI 

OQ 

I NX 

H 


MOV MI 

OQ 

CALL 

11472Q 

01 1770Q 

MOV CA 


CALL 

7166Q 

RET 


MOV CM 


011776Q 

INR L 


MOV 

BM 


CALL 

7601 Q 

LX I H 

24544Q 

012006Q 

MOV MA 


I NX 

H 


MOV MB 


MOV LI 

1 57Q 

012013Q 

MOV MI 

OQ 

LHLD 

24440Q 

I NX H 


1 NX H 


012022Q 

MOV AM 


I NX 

H 


MOV BM 


LX I H 

23156Q 

012030Q 

MOV MA 


I NX 

H 


MOV MB 


LX I H 

24550Q 

012036Q 

MOV MA 


I NX 

H 


MOV MB 


LX I H 

23155Q 

012044Q 

MOV MI 

377Q 

CALL 

11423Q 

RRC 


JNC 

12127Q 

012055Q 

MOV LI 

1 56Q 

MOV 

AM 


RLC 


CMA 


012062Q 

RRC 


JNC 


12046Q 

LHLD 

24544Q 

DCX H 


012072Q 

SHLD 

24544Q 

LX I 

H 

23156Q 

MOV CM 


INR L 


012102Q 

MOV BM 


LX I 

H 

24550Q 

MOV MC 


I NX H 


012110Q 

MOV MB 


MOV 

LI 

140Q 

MOV CM 


INR L 


012115Q 

MOV BM 


MOV 

LI 

156Q 

MOV EM 


CALL 

2640Q 

012124Q 

JMP 

12046Q 

LHLD 

24440Q 

I NX H 


I NX H 


012134Q 

XCHG 


LX I 

H 

24550Q 

MOV CM 


INR L 


012142Q 

MOV BM 


MOV 

AC 


STAX D 


I NX D 


012146Q 

MOV AB 


STAX 

; D 


DCR H 


MOV LI 

21 2Q 

012153Q 

MOV CM 


INR 

L 


MOV BM 


MOV LI 

21 OQ 

012160Q 

MOV MC 


I NX 

H 


MOV MB 


INR H 


012164Q 

MOV LI 

1 44Q 

MOV 

AM 


INR L 


MOV BM 


01 2171Q 

SUB I 

OQ 

MOV 

CA 


MOV AB 


SBC I 

OQ 

012177Q 

ORA C 


ADD 

I 

377Q 

SBC A 


MOV LI 

1 57Q 

012205Q 

ORA M 


RRC 



JNC 

12225Q 

DCR H 


012213Q 

MOV LI 

21 4Q 

MOV 

CM 


INR L 


MOV BM 


012220Q 

MOV LI 

21 OQ 

MOV 

MC 


I NX H 


MOV MB 


012225Q 

LX I H 

24212Q 

MOV 

AM 


RRC 


JNC 

1 2261Q 

012235Q 

CALL 

1 444Q 

LX I 

H 

2421OQ 

MOV MA 


I NX H 


012245Q 

MOV MB 


MOV 

EA 


MOV DB 


INR H 


012251Q 

MOV LI 

1 40Q 

MOV 

CM 


INR L 


MOV BM 


012256Q 

CALL 

2767Q 

RET 



CALL 

5376Q 

LX I H 

24204Q 

012270Q 

MOV MA 


I NX 

H 


MOV MB 


CALL 

5376Q 

012276Q 

LX I H 

24206Q 

MOV 

MA 


I NX H 


MOV MB 


012304Q 

CALL 

5376Q 

LX I 

H 

24212Q 

MOV MA 


I NX H 


012314Q 

MOV MB 


CALL 

5376Q 

LX I H 

24214Q 

MOV MA 


012324Q 

I NX H 


MOV 

MB 


MOV LI 

21 OQ 

MOV MA 


012331Q 

I NX H 


MOV 

MB 


LX I B 

420Q 

CALL 

4365Q 

012341Q 

CMA 


RRC 



JNC 

12354Q 

LX I B 

420Q 

012351Q 

CALL 

4664Q 

CALL 

1444Q 

LX I H 

24562Q 

MOV MA 


012363Q 

I NX H 


MOV 

MB 


MOV CA 


CALL 

5027Q 

012371Q 

LX I H 

24204Q 

MOV 

CM 


INR L 


MOV BM 


012377Q 

CALL 

4365Q 

CMA 



RRC 


RC 


012405Q 

LHLD 

24440Q 

I NX 

H 


I NX H 


MOV AM 


012413Q 

I NX H 


MOV 

BM 


LX I H 

24174Q 

MOV MA 


012421Q 

I NX H 


MOV 

MB 


LX I H 

23153Q 

MOV MI 

OQ 

012430Q 

MOV LI 

1 55Q 

MOV 

MI 

377Q 

CALL 

10127Q 

RRC 


012440Q 

JNC 

1 2555Q 

LX I 

H 

24174Q 

MOV CM 


INR L 


012450Q 

MOV BM 


LX I 

H 

23156Q 

MOV MC 


I NX H 


012456Q 

MOV MB 


LX I 

H 

23156Q 

MOV AM 


I NR L 


012464Q 

MOV BM 


LX I 

H 

24176Q 

SUB M 


INR L 


012472Q 

MOV CA 


MOV 

AB 


SBC M 


ORA C 


012476Q 

JZ 

1 2540Q 

MOV 

Cl 

OQ 

MOV BI 

OQ 

CALL 

2366Q 

01251OQ 

LX I H 

24565Q 

MOV 

MA 


RLC 


CMA 


012516Q 

RRC 


JNC 


12457Q 

MOV LI 

1 62Q 

MOV CM 


012525Q 

INR L 


MOV 

BM 


MOV LI 

1 65Q 

MOV EM 


012532Q 

CALL 

2640Q 

JMP 


1 2457Q 

MOV LI 

21 2Q 

MOV CM 


012543Q 

INR L 


MOV 

BM 


MOV LI 

21 OQ 

MOV MC 


012550Q 

I NX H 


MOV 

MB 


JMP 

12666Q 

LX I H 

24174Q 

012560Q 

MOV CM 


I NR 

L 


MOV BM 


LX I H 

23156Q 

012566Q 

MOV MC 


I NX 

H 


MOV MB 


LX I H 

24200Q 

012574Q 

MOV MC 


I NX 

H 


MOV MB 


LX I H 

23155Q 

012C02Q 

MOV MI 

377Q 

MOV 

Cl 

OQ 

MOV B I 

OQ 

CALL 

2366Q 

012613Q 

LX I H 

24565Q 

MOV 

MA 


SUB I 

201Q 

JZ 

12666Q 

012624Q 

MOV AM 


RLC 



CMA 


RRC 


012630Q 

JNC 

1 2604Q 

LX I 

H 

23156Q 

MOV CM 


INR L 


012640Q 

MOV BM 


LX I 

H 

24200Q 

MOV MC 


I NX H 


012646Q 

MOV MB 


INR 

H 


MOV LI 

1 62Q 

MOV CM 


012653Q 

INR L 


MOV 

BM 


MOV LI 

1 65Q 

MOV EM 


012660Q 

CALL 

2640Q 

JMP 


12604Q 

LHLD 

24440Q 

I NX H 


012672Q 

I NX H 


XCHG 


LX I H 

24200Q 

MOV CM 


0127000 

INR L 


MOV 

BM 


MOV AC 


STAX D 


012704Q 

I NX D 


MOV 

AB 


STAX D 


MOV LI 

21 2Q 

01271 IQ 

MOV AM 


RRC 



JNC 

12742Q 

CALL 

1 444Q 

012721Q 

LX I H 

2421OQ 

MOV 

MA 


I NX H 


MOV MB 


012727Q 

MOV EA 


MOV 

DB 


INR H 


MOV LI 

1 62Q 

012734Q 

MOV CM 


I NR 

L 


MOV BM 


CALL 

2767Q 

012742Q 

RET 


CALL 

5376Q 

MOV CA 


CALL 

4365Q 

012752Q 

CMA 


RRC 



RC 


LHLD 

24440Q 

012760Q 

I NX H 


I NX 

H 


PUSH H 


LX I B 

4Q 

012768Q 

LHLD 

244400 

DAD 

B 


MOV AM 


1 NX H 


0127740 

MOV SM 


MOV 

CA 


MOV LC 


MOV HB 


0130000 

1 NX H 


XCHG 


POP H 


MOV ME 



Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, 

Menlo Park, 

CA 94025 



Page 39 



Page 40 


013004Q 

I NX 

H 


MOV MD 


RET 



CALL 

5376Q 

G13012Q 

LX 1 

H 

24566Q 

MOV MA 


I NX 

H 


MOV 

MB 

013020Q 

CALL 

5376Q 

LX I H 

24570Q 

MOV 

MA 


I NX 

H 


01 303CIQ 

MOV 

MB 


RRC 


RC 



CALL 

5376Q 

013036Q 

LX I 

H 

24572Q 

MOV MA 


I NX 

H 


MOV 

MB 

013044Q 

RRC 



JNC 

130670 

MOV 

LI 

1 70Q 

MOV 

CM 


01 3053Q 

I NR 

L 


MOV BM 


DCR 

H 

MOV 

LI 

21 OQ 

0 13060Q 

MOV 

MC 


I NX H 


MOV 

MB 


RET 

01 3064Q 

JMP 


13020Q 

MOV LI 

166Q 

MOV 

CM 


I NR 

L 


0 ; 3073Q 

MOV 

BM 


I NR L 


MOV 

EM 


I NR 

L 


oi3077Q 

MOV 

DM 


CALL 

30620 

RRC 



JNC 


131240 

Ol3107Q 

LX I 

H 

24572Q 

MOV CM 


I NR 

L 


MOV 

BM 

013115Q 

DCR 

H 


MOV LI 

2100 

MOV 

MC 


I NX 

H 


013122Q 

MOV 

MB 


RET 


JMP 


13020Q 

RET 



013130Q 

CALL 

5376Q 

MOV CA 


CALL 

7601 Q 

MOV 

CA 


013140Q 

LX I 

H 

1000000 

DAD B 


XCHG 


LX I 

H 

22732Q 

013150Q 

MOV 

ME 


I NR L 


MOV 

MD 


CALI 

5376Q 

013156Q 

MOV 

CA 


CALL 

76010 

MOV 

CA 


LX I 

'h 

100000Q 

0131660 

DAD 

B 


XCHG 


LX I 

H 

22732Q 

MOV 

AM 

013174Q 

I NR 

L 


MOV BM 


SUB 

E 


MOV 

CA 


013200Q 

MOV 

AB 


SBC D 


JC 


13217Q 

CALL 

5376Q 

01321OQ 

LX 1 

H 

2421OQ 

MOV MA 


I NX 

H 


MOV 

MB 

013216Q 

RET 



CALL 

5376Q 

LX I 

H 

242100 

MOV 

MA 


0132260 

1 NX 

H 


MOV MB 


CALL 

5376Q 

LX I 

H 

2421OQ 

013236Q 

MOV 

MA 


I NX H 


MOV 

MB 


RET 

0132420 

CALL 

53760 

ANA I 

360Q 

MOV 

CA 


MOV 

AB 


0132510 

ANA 

I 

377Q 

LX I H 

24204Q 

MOV 

MC 


I NX 

H 


013260Q 

MOV 

MA 


CALL 

5376Q 

LX I 

H 

24212Q 

MOV 

MA 


0132700 

I NX 

H 


MOV MB 


MOV 

LI 

2.1 OQ 

MOV 

MA 


013275Q 

I NX 

H 


MOV MB 


CALL 

53760 

LX I 

H 

242140 

0133050 

MOV 

MA 


I NX H 


MOV 

MB 


MOV 

LI 

2040 

013312Q 

MOV 

CM 


I NR L 


MOV 

BM 


CALL 

4365Q 

013320Q 

RRC 



JNC 

13362Q 

LX I 

B 

4Q 

LHLD 

24440Q 

013332Q 

DAD 

B 


MOV AM 


1 NX 

H 


MOV 

BM 


0133360 

MOV 

CA 


CALL 

32360 

CMA 



RRC 


013344Q 

JNC 


13362Q 

LX I H 

242140 

MOV 

CM 


I NR 

L 


013354Q 

MOV 

BM 


MOV LI 

21 OQ 

MOV 

MC 


I NX 

H 


013361Q 

MOV 

MB 


RET 


LX I 

H 

245740 

MOV 

MC 


013367Q 

CALL 

10063Q 

MOV LI 

1 74Q 

SUB 

M 


SUB 

I 

2Q 

013377Q 

1 NR 

L 


MOV MA 


DCR 

L 


MOV 

AM 

013403Q 

DCR 

H 


MOV LI 

162Q 

ADD 

M 


MOV 

MA 


01341OQ 

CALL 

5376Q 

ANA I 

3600 

MOV 

CA 


MOV 

AB 


013417Q 

ANA 

I 

3770 

MOV BA 


CALL 

4365Q 

CMA 



0134260 

RRC 



RC 


CALL 

14440 

LX I 

H 

24210Q 

013436Q 

MOV 

MA 


I NX H 


MOV 

MB 


LXl 

H 

23153Q 

0134440 

MOV 

MI 

377Q 

MOV LI 

155Q 

MOV 

MI 

3770 

LX I 

B 

4Q 

013455Q 

LHLD 

24440Q 

DAD B 


MOV 

AM 


I NX 

H 

013463Q 

MOV 

BM 


LX I H 

2311OQ 

MOV 

MA 


I NX 

H 


013471Q 

MOV 

MB 


LX I H 

231100 

MOV 

CM 


I NR 

L 


0134770 

MOV 

BM 


CALL 

2366Q 

LX I 

H 

245760 

MOV 

MA 


013507Q 

SUB 

I 

201Q 

JZ 

1370 IQ 

MOV 

AM 


RLC 


013516Q 

CMA 



RRC 


JNC 


13543Q 

DCR 

H 


0135240 

MOV 

LI 

21 OQ 

MOV CM 


I NR 

L 


MOV 

BM 


013531Q 

I NR 

H 


MOV LI 

176Q 

MOV 

EM 


CALL 

2640Q 

013540Q 

JMP 


13472Q 

MOV AM 


RLC 



RLC 


013546Q 

RRC 



JNC 

13676Q 

MOV 

AM 


XRA 

I 

300Q 

013555Q 

I NR 

A 


MOV LI 

200Q 

MOV 

MA 


MOV 

LI 

1 75Q 

013563Q 

MOV 

CA 


MOV AM 


SUB 

C 


JC 


13676Q 

013571Q 

MOV 

LI 

200Q 

MOV AM 


DCR 

H 


MOV 

LI 

1 62Q 

013577Q 

ADD 

M 


MOV CA 


MOV 

B I 

OQ 

LX I 

H 

23164Q 

013606Q 

DAD 

B 


DAD B 


MOV 

AM 


I NX 

H 

0136120 

MOV 

BM 


LX I H 

23110Q 

MOV 

MA 


I NX 

H 


013620Q 

MOV 

MB 


MOV LI 

154Q 

MOV 

MI 

377Q 

LX I 

H 

2311OQ 

013630Q 

MOV 

CM 


I NR L 


MOV 

BM 


CALL 

2524Q 

013636Q 

LX I 

H 

24577Q 

MOV MA 


SUB 

I 

201 Q 

JZ 


13676Q 

013647Q 

MOV 

AM 


RLC 


CMA 



RRC 


013653Q 

JNC 


13625Q 

DCR H 


MOV 

LI 

21 OQ 

MOV 

CM 


013662Q 

I NR 

L 


MOV BM 


I NR 

H 


MOV 

LI 

1 77Q 

013667Q 

MOV 

EM 


CALL 

2640Q 

JMP 


13625Q 

JMP 

134720 

013701Q 

RET 



CALL 

5376Q 

LX I 

H 

2421OQ 

MOV 

MA 

01371 IQ 

1 NX 

H 


MOV MB 


DCR 

L 


MOV 

CM 


013715Q 

I NR 

L 


MOV BM 


CALL 

3236Q 

LX I 

H 

24221Q 

013725Q 

MOV 

MA 


LX I SP 

22712Q 

JMP 


403Q 

LX I 

H 

24601Q 

013737Q 

MOV 

MI 

OQ 

CALL 

5376Q 

LX I 

H 

24206Q 

MOV 

MA 

013750Q 

I NX 

H 


MOV MB 


CMA 



RRC 


013754Q 

JNC 


1 401OQ 

I NR H 


MOV 

LI 

201 Q 

MOV 

AM 


013763Q 

RRC 



CC 

4760 

LX I 

H 

24601Q 

MOV 

Ml 

377Q 

0137740 

DCR 

H 


MOV LI 

206Q 

MOV 

CM 


I NR 

L 

01400 IQ 

MOV 

BM 


CALL 

3334Q 

JMP 


137410 

RET 



01401 IQ 

CALL 

53760 

MOV CA 


CALL 

7601 Q 

LX I 

H 

22745Q 

014023Q 

MOV 

MA 


RET 


JMP 


14142Q 

LX I 

H 

231010 

014033Q 

MOV 

AM 


SUB I 

200Q 

JNZ 


14116Q 

MOV 

MI 

OQ 

014043Q 

MOV 

LI 

74Q 

MOV CM 


I NR 

L 


MOV 

BM 

014050Q 

MOV 

EC 


MOV DB 


MOV 

Cl 

240 

CALL 

462Q 

014057Q 

SUB 

I 

OQ 

JZ 

141160 

JMP 


14102Q 



014067Q 

104Q 11 IQ 123Q 

113Q 040Q 105Q 117Q 106Q 

040Q 040Q 

044Q 


014102Q 

LX 1 

B 

14067Q 

CALL 

6430 

LX I 

H 

24603Q 

MOV 

MI 

320 

014115Q 

RET 



LX I H 

23101Q 

MOV 

CM 


MOV 

B I 

00 

014124Q 

LHLD 

23076Q 

DAD B 


MOV 

AM 


LX I 

H 

24603Q 

014134Q 

MOV 

MA 


LX I H 

23101Q 

I NR 

M 


RET 

014142Q 

CALL 

1444Q 

LX I H 

242100 

MOV 

MA 


I NX 

H 


0141520 

MOV 

MB 


LX I H 

23155Q 

MOV 

MI 

377Q 

DCR 

H 


01 4161Q 

MOV 

LI 

347Q 

MOV AM 


RRC 



JNC 

1 4301 Q 

0141 700 

CALL 

5376Q 

LX I H 

242060 

MOV 

MA 


I NX 

H 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 Number 24 

187 



Number 24 

188 


014200Q 

MOV 

MB 


CMA 



RRC 



JNC 

14215Q 

014206Q 

DCR 

L 


MOV 

CM 


I NR 

L 


MOV BM 


014212Q 

CALL 

3334Q 

LX I 

B 

22750Q 

MOV 

EC 


MOV DB 


014222Q 

MOV 

Cl 

12Q 

CALL 

446Q 

CALL 

476Q 

LX I H 

24602Q 

014235Q 

MOV 

MI 

10 

LX I 

H 

22750Q 

I NX 

H 


MOV AM 


014244Q 

LX I 

H 

24602Q 

SUB 

M 


JC 


1441 IQ 

I NR M 


014254Q 

MOV 

CM 


MOV 

BI 

OQ 

LX I 

H 

22750Q 

DAD B 


014263Q 

MOV 

AM 


MOV 

EA 


LX I 

H 

2421OQ 

MOV CM 


014271Q 

I NR 

L 


MOV 

BM 


CALL 

2640Q 

JMP 

14237Q 

014301Q 

LX! 

H 

24604Q 

MOV 

MI 

377Q 

CALL 

14030Q 

LX I H 

24603Q 

014314Q 

MOV 

AM 


LX I 

H 

23103Q 

SUB 

M 


RZ 

014322Q 

LX I 

H 

246030 

MOV 

AM 


SUB 

I 

32Q 

JNZ 

1 4341Q 

014333Q 

LX I 

H 

22747Q 

MOV 

MI 

377Q 

RET 



MOV AM 

014342Q 

SUB 

I 

1 40Q 

JNZ 


14356Q 

I NR 

L 


MOV AM 


014351Q 

CMA 



MOV 

MA 


JMP 


14306Q 

MOV AM 


014357Q 

SUB 

I 

40Q 

SBC 

A 


CMA 



I NR L 


014364Q 

ANA 

M 


RRC 



JNC 


14406Q 

DCR H 


014372Q 

MOV 

LI 

21 OQ 

MOV 

CM 


I NR 

L 


MOV BM 


014377Q 

1 NR 

H 


MOV 

LI 

203Q 

MOV 

EM 


CALL 

2640Q 

014406Q 

JMP 


14306Q 

RET 



CALL 

1444Q 

LX I H 

2421OQ 

014420Q 

MOV 

MA 


I NX 

H 


MOV 

MB 


CALL 

5376Q 

0144260 

LX! 

H 

2311OQ 

MOV 

MA 


I NX 

H 


MOV MB 

014434Q 

MOV 

LI 

1 53Q 

MOV 

MI 

377Q 

MOV 

LI 

155Q 

MOV MI 

377Q 

0144440 

LX! 

H 

231100 

MOV 

CM 


I NR 

L 


MOV BM 


014452Q 

CALL 

2366Q 

LX I 

H 

24605Q 

MOV 

MA 


MOV Cl 

OQ 

0144S3G 

MOV 

B I 

OQ 

CALL 

2366Q 

LX I 

H 

24606Q 

MOV MA 

0144740 

DCR 

L 


MOV 

AM 


SUB 

I 

201 Q 

SUB I 

IQ 

014502Q 

SBC 

A 


I NR 

L 


MOV 

CA 


MOV AM 

014506Q 

SUB 

I 

201 Q 

SUB 

I 

IQ 

SBC 

A 


ORA C 


014514Q 

RRC 



RC 



DCR 

L 


MOV CM 


014520Q 

CALL 

10005Q 

ADD 

A 


ADD 

A 


ADD A 


014526Q 

ADD 

A 


MOV 

CA 


PUSH B 


LX I H 

24606Q 

014534Q 

MOV 

CM 


CALL 

10005Q 

POP 

D 


ORA E 

014542Q 

MOV 

EA 


LX I 

H 

24210Q 

MOV 

CM 


I NR L 


014550Q 

MOV 

BM 


CALL 

2640Q 

JMP 


14444Q 

RET 


014560Q 

CALL 

5376Q 

LX I 

H 

24206Q 

MOV 

MA 


I NX H 


014570Q 

MOV 

MB 


RRC 



RC 



LX I H 

23153Q 

014576Q 

MOV 

MI 

377Q 

MOV 

LI 

155Q 

MOV 

MI 

377Q 

CALL 

1444Q 

014607Q 

LX I 

H 

2421OQ 

MOV 

MA 


I NX 

H 


MOV MB 

014615Q 

LX! 

H 

24206Q 

MOV 

CM 


I NR 

L 


MOV BM 


014623Q 

CALL 

2366Q 

LX I 

H 

24607Q 

MOV 

MA 


SUB I 

201 Q 

014634Q 

JZ 


1471 IQ 

MOV 

AM 


RLC 



RLC 

014642Q 

RLC 



RLC 



ANA 

I 

17Q 

MOV CA 


014647Q 

CALL 

1 0041 Q 

MOV 

EA 


LX I 

H 

2421OQ 

MOV CM 


014657Q 

I NR 

L 


MOV 

BM 


CALL 

2640Q 

LX I H 

24607Q 

014667Q 

MOV 

AM 


ANA 

I 

1 7Q 

MOV 

CA 


CALL 

1 0041 Q 

014676Q 

MOV 

EA 


MOV 

Cl 

OQ 

MOV 

BI 

OQ 

CALL 

2640Q 

014706Q 

JMP 


14615Q 

RET 



CALL 

5376Q 

ANA I 

360Q 

014717Q 

MOV 

CA 


MOV 

AB 


ANA 

I 

377Q 

MOV BA 


014724Q 

CALL 

3530Q 

RET 



LX I 

B 

426Q 

CALL 

4365Q 

014736Q 

CMA 



RRC 



JNC 


14751Q 

LX I B 

426Q 

014746Q 

CALL 

4664Q 

CALL 

5376Q 

LX I 

H 

2461OQ 

MOV MA 

014760Q 

I NX 

H 


MOV 

MB 


CALL 

5376Q 

LX I H 

24212Q 

014770Q 

MOV 

MA 


I NX 

H 


MOV 

MB 


CALL 

5376Q 

014776Q 

LX! 

H 

24214Q 

MOV 

MA 


1 NX 

H 


MOV MB 


015004Q 

CALL 

14412Q 

LX I 

H 

23153Q 

MOV 

MI 

377Q 

LX I H 

2421OQ 

015017Q 

MOV 

CM 


I NR 

L 


MOV 

BM 


CALL 

2366Q 

015O25Q 

LX 1 

H 

23113Q 

MOV 

MA 


SUB 

I 

201 Q 

JZ 

1 5042Q 

015036Q 

MOV 

CM 


MOV 

LI 

1 02Q 

MOV 

MC 


LX I H 

2421OQ 

015045Q 

MOV 

CM 


1 NR 

L 


MOV 

BM 


CALL 

2052Q 

015053Q 

LX! 

H 

2461OQ 

MOV 

CM 


I NR 

L 


MOV BM 

015061Q 

CALL 

3606Q 

RRC 



JNC 


15117Q 

LX I H 

2421OQ 

015073Q 

MOV 

CM 


I NR 

L 


MOV 

BM 


CALL 

5027Q 

015101Q 

LX I 

H 

24212Q 

MOV 

CM 


I NR 

L 


MOV BM 

015107Q 

MOV 

LI 

21 OQ 

MOV 

MC 


I NX 

H 


MOV MB 


0151140 

JMP 


15143Q 

LX I 

H 

2421OQ 

MOV 

CM 


I NR L 


015124Q 

MOV 

BM 


CALL 

5027Q 

LX I 

H 

24214Q 

MOV CM 


015134Q 

I NR 

L 


MOV 

BM 


MOV 

LI 

21 OQ 

MOV MC 


01 5141Q 

I NX 

H 


MOV 

MB 


RET 



CALL 

5376Q 

01 5147Q 

LX I 

H 

24206Q 

MOV 

MA 


I NX 

H 


MOV MB 

01 51550 

CMA 



RRC 



JNC 


15200Q 

DCR L 


01 51630 

MOV 

CM 


I NR 

L 


MOV 

BM 


CALL 

4365Q 

01 51 71 Q 

RRC 



CC 


4602Q 

JMP 


15144Q 

RET 

0152010 

LX! 

H 

24612Q 

MOV 

MI 

OQ 

I NX 

H 

MOV MI 

OQ 

01521 IQ 

CALL 

5376Q 

LX I 

H 

24206Q 

MOV 

MA 


I NX H 

015221Q 

MOV 

MB 


CMA 



RRC 


JNC 

15256Q 

01 5227Q 

DCR 

L 


MOV 

CM 


I NR 

L 


MOV BM 

0152330 

CALL 

7601 Q 

MOV 

CA 


LX I 

H 

246120 

MOV EM 


015243Q 

1 NR 

L 


MOV 

DM 


MOV 

LC 

MOV HB 


015247Q 

DAD 

D 


SHLD 

24612Q 

JMP 


1521 IQ 

I NR H 


0152570 

MOV 

LI 

21 2Q 

MOV 

CM 


I NR 

L 

MOV BM 


0152640 

CALL 

7166Q 

RET 



CALL 

5376Q 

MOV CA 


015274Q 

CALL 

7601 Q 

LX! 

H 

22730Q 

MOV 

MA 

I NR L 


015304Q 

MOV 

MB 


CALL 

5376Q 

MOV 

CA 


CALL 

7601Q 

015314Q 

LX! 

H 

22730Q 

MOV 

CA 


MOV 

AM 


I NR L 

015322Q 

MOV 

DM 


SUB 

C 


MOV 

EA 


MOV AD 


015326Q 

SBC 

B 


MOV 

CE 


MOV 

BA 


CALL 

71 66Q 

0153340 

RET 



LX I 

H 

24614Q 

MOV 

MI 

IQ 

I NX H 

0153430 

MOV 

MI 

OQ 

CALL 

5376Q 

LX I 

H 

24206Q 

MOV MA 


015354Q 

I NX 

H 


MOV 

MB 


CMA 



RRC 


015360Q 

JNC 


15477Q 

DCR 

L 


MOV 

CM 


I NR L 


015366Q 

MOV 

BM 


CALL 

7601 Q 

MOV 

CA 


LX I H 

22726Q 

015376Q 

MOV 

MC 


I NR 

L 


MOV 

MB 


LX I H 

22726Q 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, 

Box E, 

Menlo Park, 

CA 94025 



Page 41 



Page 42 


015404Q 

MOV EM 


INR L 


MOV DM 


LX I H 

24614Q 

015412Q 

MOV CM 


INR L 


MOV BM 


JMP 

15463Q 

015420Q 

MOV AC 


SUB E 


MOV AB 


SBC D 


015424Q 

JP 

15434Q 

MOV HB 


MOV LC 


XCHG 


015432Q 

MOV BH 


MOV CL 


LX I H 

OQ 

XCHG 


015440Q 

MOV AB 


ORA C 


RZ 


XCHG 


015444Q 

MOV AB 


RAR 


MOV BA 


MOV AC 


015450Q 

RAR 


MOV CA 


JNC 

15456Q 

DAD D 


015456Q 

XCHG 


DAD H 


JMP 

15440Q 

CALL 

15420Q 

015466Q 

LX I H 

24614Q 

MOV ME 


I NX H 


MOV MD 


015474Q 

JMP 

15345Q 

INR H 


MOV LI 

21 4Q 

MOV CM 


015503Q 

I NR L 


MOV BM 


CALL 

7166Q 

RET 


01551 IQ 

CALL 

5376Q 

MOV CA 


CALL 

7601Q 

LX I H 

22724Q 

015523Q 

MOV MA 


INR L 


MOV MB 


CALL 

5376Q 

015531Q 

MOV CA 


CALL 

760 IQ 

MOV CA 


LX I H 

22722Q 

015541Q 

MOV MC 


INR L 


MOV MB 


LX I H 

22722Q 

015547Q 

MOV EM 


INR L 


MOV DM 


INR L 


015553Q 

MOV CM 


INR L 


MOV BM 


CALL 

7346Q 

015561Q 

MOV CE 


MOV BD 


CALL 

71 660 

RET 


015567Q 

CALL 

5376Q 

MOV CA 


CALL 

7601 Q 

MOV CA 


015577Q 

CALL 

1 073Q 

RET 


CALL 

5376Q 

LX I H 

24206Q 

01561 IQ 

MOV MA 


I NX H 


MOV MB 


CMA 


015615Q 

RRC 


JNC 

16003Q 

LX I H 

23153Q 

MOV MI 

377Q 

015626Q 

LX I H 

24206Q 

MOV CM 


INR L 


MOV BM 


015634Q 

CALL 

2366Q 

LX I H 

24621 Q 

MOV MA 


SUB I 

1 57Q 

015645Q 

JNZ 

15673Q 

MOV Cl 

OQ 

MOV B1 

OQ 

CALL 

2366Q 

015657Q 

SUB 1 

1 41Q 

SUB I 

IQ 

SBC A 


LX 1 H 

23144Q 

015667Q 

MOV MA 


JMP 

15603Q 

MOV AM 


SUB I 

1 64Q 

015676Q 

JNZ 

15723Q 

DCR H 


MOV LI 

206Q 

MOV CM 


015705Q 

I NR L 


MOV BM 


CALL 

7601 Q 

LX I H 

23072Q 

015715Q 

MOV MA 


I NX H 


MOV MB 


JMP 

16000Q 

015723Q 

MOV AM 


SUB I 

155Q 

JNZ 

15747Q 

MOV Cl 

OQ 

015733Q 

MOV BI 

OQ 

CALL 

2366Q 

LX I H 

23103Q 

MOV MA 


015744Q 

JMP 

16000Q 

MOV AM 


SUB I 

160Q 

JNZ 

15765Q 

015755Q 

LX I H 

22744Q 

MOV Ml 

377Q 

JMP 

16000Q 

MOV AM 


015766Q 

SUB I 

1 44Q 

JNZ 

16000Q 

LX I H 

22744Q 

MOV MI 

OQ 

016000Q 

JMP 

15603Q 

RET 


CALL 

5376Q 

MOV CA 


01601OQ 

CALL 

7601 Q 

LX I H 

22720Q 

MOV MA 


INR L 


016020Q 

MOV MB 


CALL 

5376Q 

MOV CA 


CALL 

7601Q 

016030Q 

MOV CA 


LX I H 

22716Q 

MOV MC 


INR L 


016036Q 

MOV MB 


LX I H 

22716Q 

MOV EM 


INR L 


016044Q 

MOV DM 


INR L 


MOV CM 


INR L 


016050Q 

MOV BM 


CALL 

7346Q 

CALL 

7166Q 

RET 


016060Q 

LX I H 

23150Q 

MOV CM 


INR L 


MOV BM 


016066Q 

MOV LI 

1 1 OQ 

MOV MC 


I NX H 


MOV MB 


016073Q 

LX I H 

24622Q 

MOV MI 

OQ 

I NX H 


MOV MI 

OQ 

016103Q 

LX I H 

2311OQ 

MOV CM 


INR L 


MOV BM 


01611 IQ 

MOV CB 


XRA A 


SUB C 


JNC 

16145Q 

01 6117Q 

LHLD 

24622Q 

1 NX H 


SHLD 

24622Q 

LHLD 

2311OQ 

01 6131Q 

MOV AM 


1 NX H 


MOV BM 


LX I H 

2311OQ 

016137Q 

MOV MA 


I NX H 


MOV MB 


JMP 

16103Q 

016145Q 

LX I H 

24622Q 

MOV CM 


INR L 


MOV BM 


016153Q 

CALL 

7166Q 

RET 


CALL 

5376Q 

MOV CA 


016163Q 

CALL 

7601 Q 

LX I H 

22714Q 

MOV MA 


I NR L 


016173Q 

MOV MB 


CALL 

5376Q 

MOV CA 


CALL 

760 IQ 

016203Q 

MOV EA 


MOV DB 


LX I H 

22714Q 

MOV CM 


01621 IQ 

INR L 


MOV BM 


CALL 

1744Q 

RET 


016217Q 

CALL 

1 444Q 

LX I H 

2421OQ 

MOV MA 


I NX H 


016227Q 

MOV MB 


LX I H 

23155Q 

MOV MI 

377Q 

LX I H 

2421OQ 

016240Q 

MOV CM 


INR L 


MOV BM 


MOV El 

63Q 

016245Q 

CALL 

2640Q 

MOV Cl 

OQ 

MOV BI 

OQ 

MOV El 

61 Q 

016256Q 

CALL 

2640Q 

MOV Cl 

OQ 

MOV B1 

OQ 

MOV El 

1 41Q 

016267Q 

CALL 

2640Q 

RET 


LX I H 

24624Q 

MOV MC 


0162770 

I NX H 


MOV MB 


LHLD 

23074Q 

MOV MI 

OQ 

016306Q 

LX 1 H 

24627Q 

MOV MI 

IQ 

MOV AI 

13Q 

LX I H 

24627Q 

016320Q 

SUB M 


JC 

1 6344Q 

MOV CM 


MOV B1 

OQ 

016327Q 

LHLD 

23074Q 

DAD B 


MOV MI 

40Q 

LX I H 

24627Q 

016340Q 

INR M 


JNZ 

16313Q 

MOV MI 

OQ 

MOV LI 

231 Q 

016350Q 

MOV Ml 

OQ 

LX I H 

23153Q 

MOV MI 

377Q 

LX I H 

24627Q 

016362Q 

MOV AM 


SUB I 

1 3Q 

SBC A 


MOV CA 


016367Q 

PUSH B 


MOV LI 

224Q 

MOV CM 


I NR L 


016374Q 

MOV BM 


CALL 

2366Q 

LX 1 H 

24630Q 

MOV MA 


016404Q 

SUB I 

20 IQ 

POP D 


ADD I 

377Q 

SBC A 


016412Q 

ANA E 


RRC 


JNC 

16513Q 

MOV AM 


016420Q 

SUB I 

72Q 

JNZ 

16443Q 

INR L 


MOV CM 


016427Q 

LHLD 

23074Q 

MOV MC 


LX I H 

24627Q 

MOV MI 

OQ 

016440Q 

JMP 

1 6357Q 

MOV AM 


SUB I 

56Q 

JNZ 

1 6457Q 

016451Q 

DCR L 


MOV MI 

1 OQ 

JMP 

1651OQ 

DCR L 


016460Q 

INR M 


MOV CM 


MOV BI 

OQ 

LHLD 

23074Q 

016467Q 

DAD B 


PUSH H 


LX I H 

24630Q 

MOV CM 


016475Q 

CALL 

757Q 

POP H 


MOV MA 


LX I H 

24630Q 

016505Q 

MOV CM 


INR L 


MOV MC 


JMP 

16357Q 

016513Q 

CALL 

666Q 

RET 


LX I H 

24632Q 

MOV MC 


016523Q 

1 NX H 


MOV MB 


LX 1 B 

1 4Q 

LHLD 

23074Q 

016533Q 

DAD B 


XCHG 


MOV Cl 

7Q 

PUSH D 


016540Q 

LX 1 H 

24632Q 

MOV EM 


INR L 


MOV DM 


016546Q 

MOV AD 


ORA A 


RAR 


MOV DA 


016552Q 

MOV AE 


RAR 


MOV EA 


DCR C 


016556Q 

JNZ 

16546Q 

POP H 


MOV ME 


LX I B 

40Q 

016566Q 

LHLD 

23074Q 

DAD B 


XCHG 


LX I H 

24632Q 

016576Q 

MOV AM 


INR L 


MOV BM 


ANA I 

1 77Q 

016603Q 

MOV CA 


MOV AB 


ANA I 

OQ 

MOV BA 



Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 24 

189 



01661OQ 

MOV AC 


STAX D 


RET 



LX 1 B 

14Q 

016616Q 

LHLD 

23074Q 

DAD B 


MOV 

AM 


MOV El 

7Q 

016625Q 

ADD A 


DCR E 


JNZ 


16625Q 

LX I D 

40Q 

016635Q 

LHLD 

23074Q 

DAD D 


MOV 

CA 


MOV AM 


016643Q 

ORA C 


MOV CA 


MOV 

BI 

OQ 

CALL 

7166Q 

0165520 

RET 


CALL 

5376Q 

MOV 

CA 


CALL 

16273Q 

016662Q 

CALL 

5376Q 

MOV CA 


CALL 

7601 Q 

MOV CA 


016672Q 

CALL 

16517Q 

CALL 

5376Q 

LX I 

H 

2421OQ 

MOV MA 


016704Q 

I NX H 


MOV MB 


LX I 

H 

23074Q 

MOV CM 


016712Q 

I NR L 


MOV BM 


MOV 

EC 


MOV DB 


016716Q 

MOV Cl 

17Q 

CALL 

462Q 

SUB 

I 

377Q 

JNZ 

16741Q 

016730Q 

CALL 

5376Q 

LX I H 

2421OQ 

MOV 

MA 


I NX H 


016740Q 

MOV MB 


RET 


CALL 

5376Q 

MOV CA 


016746Q 

CALL 

16273Q 

MOV Cl 

OQ 

MOV 

BI 

OQ 

CALL 

16517Q 

016760Q 

CALL 

5376Q 

LX I H 

2421OQ 

MOV 

MA 


I NX H 

016770Q 

MOV MB 


LX I H 

23074Q 

MOV 

CM 


INR L 


016776Q 

MOV BM 


MOV EC 


MOV 

DB 


MOV Cl 

26Q 

017003Q 

CALL 

462Q 

SUB I 

377Q 

JNZ 


17024Q 

CALL 

5376Q 

017016Q 

LX I H 

2421OQ 

MOV MA 


1 NX 

H 


MOV MB 

017024Q 

RET 


CALL 

5376Q 

LX I 

H 

2421OQ 

MOV MA 


0170340 

I NX H 


MOV MB 


LX I 

H 

23074Q 

MOV CM 


017042Q 

I NR L 


MOV BM 


MOV 

EC 


MOV DB 


017046Q 

MOV Cl 

20Q 

CALL 

462Q 

SUB 

I 

377Q 

JNZ 

1 7071Q 

017060Q 

CALL 

5376Q 

LX I H 

2421OQ 

MOV 

MA 


I NX H 

017070Q 

MOV MB 


RET 


LX I 

H 

23074Q 

MOV CM 


017076Q 

INR L 


MOV BM 


MOV 

EC 


MOV DB 


017102Q 

MOV Cl 

23Q 

CALL 

446Q 

RET 



JMP 

17224Q 

0171130 

LX 1 H 

24637Q 

MOV AM 


SUB 

I 

OQ 

RNZ 

017122Q 

LX I H 

23101Q 

MOV CM 


MOV 

B I 

OQ 

LHLD 

23076Q 

0171330 

DAD B 


XCHG 


LX I 

H 

24635Q 

MOV CM 

01 7141Q 

MOV AC 


STAX D 


LX I 

H 

23101Q 

I NR M 


017147Q 

MOV AM 


SUB 1 

200Q 

JNZ 


17223Q 

MOV LI 

74Q 

017157Q 

MOV CM 


INR L 


MOV 

BM 


MOV EC 

017163Q 

MOV DB 


MOV Cl 

25Q 

CALL 

462Q 

LX I H 

24637Q 

017174Q 

MOV MA 


LX I H 

23101Q 

MOV 

MI 

OQ 

LHLD 

24440Q 

017205Q 

I NX H 


I NX H 


XCHG 


LX I H 

23156Q 

017213Q 

MOV CM 


INR L 


MOV 

BM 


MOV AC 

017217Q 

STAX D 


I NX D 


MOV 

AB 


STAX D 


017223Q 

RET 


LX I H 

24637Q 

MOV 

MI 

OQ 

LX I H 

23101Q 

017234Q 

MOV Ml 

OQ 

CALL 

5376Q 

MOV 

CA 


CALL 

4365Q 

017245Q 

CMA 


RRC 


RC 



LX 1 B 

4Q 

0172530 

LHLD 

24440Q 

DAD B 


MOV 

AM 


I NX H 

017261Q 

MOV BM 


MOV CA 


MOV 

LC 


MOV HB 


017265Q 

1 NX H 


SHLD 

23156Q 

MOV 

Cl 

OQ 

MOV BI 

OQ 

017275Q 

CALL 

2366Q 

LX I H 

24635Q 

MOV 

MA 


SUB 1 

201 Q 

017306Q 

JZ 

17317Q 

CALL 

17113Q 

JMP 


1 7271Q 

LX I H 

23154Q 

017322Q 

MOV MI 

377Q 

CALL 

5376Q 

ANA 

I 

360Q 

MOV CA 

017332Q 

MOV AB 


ANA 1 

377Q 

MOV 

BA 


CALL 

2524Q 

017341Q 

LX I H 

24635Q 

MOV MA 


SUB 

I 

201 Q 

JZ 

17400Q 

017352Q 

INR L 


MOV MI 

OQ 

MOV 

AI 

1 77Q 

LX 1 H 

24636Q 

017362Q 

SUB M 


JC 

17400Q 

CALL 

17113Q 

LX I H 

24636Q 

017374Q 

INR M 


JNZ 

17355Q 

CALL 

5376Q 

LX I H 

2421OQ 

0174060 

MOV MA 


I NX H 


MOV 

MB 


INR H 

017412Q 

MOV LI 

237Q 

MOV AM 


SUB 

I 

OQ 

JZ 

17433Q 

017422Q 

CALL 

5376Q 

LX I H 

2421OQ 

MOV 

MA 


I NX H 

017432Q 

MOV MB 


RET 


CALL 

3376Q 

LX I H 

24206Q 

017442Q 

MOV MA 


I NX H 


MOV 

MB 


MOV CA 

017446Q 

CALL 

4365Q 

CMA 


RRC 



JNC 

17476Q 

017456Q 

LX 1 H 

24206Q 

MOV CM 


INR 

L 


MOV BM 

017464Q 

CALL 

4664Q 

CALL 

1444Q 

MOV 

CA 


CALL 

5027Q 

0174760 

CALL 

5376Q 

MOV CA 


CALL 

760 IQ 

LX I H 

24640Q 

0175100 

MOV MA 


I NX H 


MOV 

MB 

CALL 

5376Q 

0175160 

LX I H 

2421OQ 

MOV MA 


I NX 

H 


MOV MB 

017524Q 

XRA A 


LX I H 

24640Q 

SUB 

M 


INR L 


017532Q 

MOV CA 


MOV AI 

OQ 

SBC 

M 


JNC 

17726Q 

017541Q 

LHLD 

24640Q 

DCX H 


SHLD 

24640Q 

LX 1 H 

23074Q 

01 7553Q 

MOV CM 


INR L 


MOV 

BM 


MOV EC 

017557Q 

MOV DB 


MOV Cl 

24Q 

CALL 

462Q 

SUB I 

OQ 

017567Q 

JZ 

17604Q 

CALL 

5376Q 

LX 1 

H 

2421OQ 

MOV MA 

017601Q 

I NX H 


MOV MB 


RET 



LHLD 

23076Q 

017607Q 

MOV AM 


LX I D 

4Q 

LHLD 

24440Q 

DAD D 


017617Q 

MOV CA 


MOV AM 


I NX 

H 


MOV DM 


017623Q 

MOV EA 


CALL 

2167Q 

LX I 

H 

23160Q 

MOV MA 


017633Q 

I NX H 


MOV MB 


DCR 

L 


MOV AM 


017637Q 

INR L 


MOV BM 


ANA 

I 

360Q 

MOV CA 


017644Q 

MOV AB 


ANA I 

377Q 

INR 

L 


MOV MC 


017651Q 

I NX H 


MOV MA 


MOV 

LI 

1 55Q 

MOV MI 

OQ 

017657Q 

MOV LI 

1 01Q 

MOV MI 

IQ 

MOV 

AI 

1 77Q 

LX I H 

23101Q 

017670Q 

SUB M 


JC 

17524Q 

MOV 

CM 


MOV BI 

OQ 

017677Q 

LHLD 

23076Q 

DAD B 


MOV 

AM 


MOV EA 


017705Q 

MOV Cl 

OQ 

MOV BI 

OQ 

CALL 

2640Q 

LX I H 

23101Q 

017717Q 

INR M 


JNZ 

17663Q 

JMP 


17524Q 

RET 


017727Q 

LX I H 

22747Q 

MOV MI 

OQ 

INR 

H 


MOV LI 

1 01 Q 

017737Q 

MOV MI 

200Q 

CALL 

14025Q 

RET 



JMP 

20035Q 

017750Q 

LX 1 H 

24652Q 

MOV MC 


I NX 

H 


MOV MB 

017756Q 

MOV LI 

255Q 

MOV MI 

OQ 

MOV 

A I 

47Q 

LX I H 

24655Q 

017767Q 

SUB M 


JC 

20032Q 

MOV 

CM 


MOV BI 

OQ 

017776Q 

INR L 


DAD B 


DAD 

B 


MOV AM 


020002Q 

I NX H 


MOV BM 


LX I 

H 

24652Q 

SUB M 


020010Q 

INR L 


MOV CA 


MOV 

AB 


SBC M 


020014Q 

ORA C 


JNZ 

20024Q 

MOV 

LI 

255Q 

MOV AM 


020023Q 

RET 


MOV LI 

255Q 

I NR 

M 


JNZ 

17762Q 

020032Q 

MOV A1 

50Q 

RET 


LX I 

H 

24162Q 

MOV CM 


020041Q 

INR C 


MOV BI 

OQ 

LX I 

H 

23164Q 

DAD B 



Number 24 Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 

190 


Page 43 



Page 44 


020050Q 

DAD B 


XCHG 


LX 1 

H 

24216Q 

MOV AM 


020056Q 

INR L 


MOV BM 


ORA 

I 

1 IQ 

MOV CA 


020063Q 

MOV AB 


ORA I 

OQ 

MOV 

BA 


MOV AC 


020070Q 

STAX D 


1 NX D 


MOV 

AB 


STAX D 


020074Q 

LX I H 

24162Q 

MOV CM 


MOV 

BI 

OQ 

LX I H 

23164Q 

020105Q 

DAD B 


DAD B 


MOV 

AM 


I NX H 


02011 IQ 

MOV BM 


RRC 


CMA 



RRC 


020115Q 

JNC 

20127Q 

LX I H 

24162Q 

DCR 

M 


JMP 

20074Q 

020127Q 

LX 1 H 

24162Q 

MOV CM 


MOV 

B I 

OQ 

LX I H 

23164Q 

020140Q 

DAD B 


DAD B 


MOV 

AM 


I NX H 


020144Q 

MOV BM 


RRC 


JNC 


20157Q 

LX I SP 

22712Q 

020154Q 

JMP 

403Q 

LX I H 

241620 

MOV 

CM 


1 NR L 


020164Q 

MOV MC 


DCR L 


MOV 

CM 


MOV B1 

OQ 

020171Q 

LX I H 

23164Q 

DAD B 


DAD 

B 


MOV AM 


020177Q 

I NX H 


MOV BM 


ANA 

I 

4Q 

MOV CA 


020204Q 

MOV AB 


ANA I 

OQ 

LX 1 

H 

24167Q 

MOV MC 


020213Q 

CALL 

631 Q 

RRC 


CC 


551 3Q 

LX 1 H 

24203Q 

020225Q 

MOV AM 


RRC 


CC 


5416Q 

LX I H 

24162Q 

020235Q 

MOV CM 


MOV B! 

OQ 

LX I 

H 

23164Q 

DAD B 


020244Q 

DAD B 


MOV AM 


I NX 

H 


MOV BM 


020250Q 

ANA I 

360Q 

MOV CA 


MOV 

AB 


ANA I 

377Q 

020256Q 

LX 1 H 

24642Q 

MOV MC 


1 NX 

H 


MOV MA 


020264Q 

DCR H 


MOV LI 

21 6Q 

MOV 

CM 


I NR L 


020271Q 

MOV BM 


MOV LI 

21 OQ 

MOV 

MC 


I NX H 


020276Q 

MOV MB 


LX I B 

2Q 

LHLD 

24642Q 

DAD B 


020306Q 

MOV AM 


LX I H 

24650Q 

MOV 

MA 


LX 1 B 

3Q 

020316Q 

LHLD 

24642Q 

DAD B 


MOV 

AM 


LX I H 

24651Q 

020326Q 

MOV MA 


SUB I 

201 Q 

SUB 

1 

IQ 

SBC A 


020334Q 

LX I D 

4Q 

LHLD 

24642Q 

DAD 

D 


MOV CA 


020344Q 

MOV AM 


SUB I 

201 Q 

ADD 

1 

377Q 

SBC A 


020352Q 

ORA C 


LX I H 

24650Q 

MOV 

EA 


MOV AM 


020360Q 

SUB I 

1 41Q 

SBC A 


ORA 

E 


MOV CA 


020365Q 

MOV A1 

1 72Q 

SUB M 


SBC 

A 


ORA C 


020372Q 

RRC 


JNC 

20407Q 

MOV 

Cl 

OQ 

DCR C 


020401Q 

CALL 

13363Q 

JMP 

21173Q 

LHLD 

246420 

I NX H 


020413Q 

1 NX H 


MOV AM 


I NX 

H 


MOV BM 


020417Q 

MOV CA 


CALL 

17750Q 

MOV 

LA 


MOV HI 

OQ 

020426Q 

JMP 

21037Q 

CALL 

10471Q 

JMP 


21173Q 

CALL 

13007Q 

020442Q 

JMP 

21173Q 

CALL 

12262Q 

JMP 


21173Q 

CALL 

13242Q 

020456Q 

JMP 

21173Q 

CALL 

13130Q 

JMP 


21173Q 

CALL 

12743Q 

020472Q 

JMP 

211730 

CALL 

11420Q 

JMP 


21173Q 

CALL 

1 1051Q 

020506Q 

JMP 

21173Q 

CALL 

144120 

JMP 


21173Q 

CALL 

1 5201Q 

020522Q 

JMP 

21173Q 

CALL 

10623Q 

JMP 


21173Q 

CALL 

15144Q 

020536Q 

JMP 

21173Q 

CALL 

15270Q 

JMP 


21173Q 

CALL 

15335Q 

020552Q 

JMP 

21173Q 

CALL 

16004Q 

JMP 


21173Q 

CALL 

17434Q 

020566Q 

JMP 

21173Q 

CALL 

1711OQ 

JMP 


21173Q 

CALL 

16653Q 

020602Q 

JMP 

21173Q 

CALL 

17025Q 

JMP 


21173Q 

CALL 

16613Q 

020616Q 

JMP 

21173Q 

CALL 

16742Q 

JMP 


21173Q 

CALL 

17072Q 

020632Q 

JMP 

21173Q 

CALL 

17727Q 

JMP 


21173Q 

CALL 

1 551 1 Q 

020646Q 

JMP 

21173Q 

CALL 

14560Q 

JMP 


21173Q 

CALL 

13734Q 

020662Q 

JMP 

21 173Q 

CALL 

14712Q 

JMP 


21173Q 

CALL 

14730Q 

020676Q 

JMP 

21173Q 

CALL 

15603Q 

JMP 


21173Q 

CALL 

13702Q 

020712Q 

JMP 

21173Q 

CALL 

16060Q 

JMP 


21173Q 

CALL 

5465Q 

020726Q 

JMP 

21173Q 

CALL 

5503Q 

JMP 


21173Q 

CALL 

1 401 IQ 

020742Q 

JMP 

21173Q 

CALL 

16217Q 

JMP 


21173Q 

MOV Cl 

OQ 

020755Q 

CALL 

13363Q 

JMP 

21173Q 

CALL 

14025Q 

JMP 

21173Q 

020771Q 

CALL 

15567Q 

JMP 

21173Q 

CALL 

16157Q 

JMP 

21173Q 

0210050 

LX I H 

23104Q 

MOV Ml 

377Q 

MOV 

Cl 

OQ 

MOV El 

OQ 

021016Q 

MOV D1 

OQ 

CALL 

446Q 

JMP 


21173Q 

MOV Cl 

OQ 

021030Q 

DCR C 


CALL 

13363Q 

JMP 


21173Q 

DAD H 


021040Q 

LX I B 

21051Q 

DAD B 


MOV 

EM 


I NX H 


021046Q 

MOV DM 


XCHG 


PCHL 




021051Q 

031Q 041Q 037Q 

04IQ 045Q 

041Q 053Q 0410 

061Q 041Q 

067Q 041Q 075Q 

021067Q 

103Q 041Q 11 IQ 

041Q 117Q 

041Q 125Q 041Q 

133Q 04IQ 

141Q 041Q 147Q 

021105Q 

155Q 041Q 163Q 

041Q 171Q 

041Q 177Q 041Q 

205Q 041Q 

213Q 04IQ 22IQ 

021123Q 

227Q 041Q 235Q 

041Q 243Q 

041Q 251Q 041Q 

257Q 041Q 

265Q 04IQ 273Q 

021141Q 

301Q 041Q 307Q 

04IQ 3150 

041Q 323Q 04IQ 

331Q 041Q 

337Q 04IQ 345Q 

021157Q 

353Q 04IQ 363Q 

041Q 371Q 

041Q 377Q 041Q 

005Q 042Q 

026Q Od2Q 

021173Q 

LX I H 

2421OQ 

MOV AM 


INR 

L 


MOV BM 


021201Q 

ANA I 

360Q 

MOV CA 


MOV 

AB 


ANA I 

377Q 

021207Q 

DCR L 


MOV MC 


I NX 

H 


MOV MA 


021213Q 

MOV LI 

1 63Q 

MOV CM 


DCR 

L 


MOV MC 


021220Q 

LX I H 

24162Q 

MOV CM 


MOV 

B I 

OQ 

LX I H 

23164Q 

021231Q 

DAD B 


DAD B 


MOV 

AM 


I NX H 


021235Q 

MOV BM 


CMA 


RRC 



JNC 

21 355Q 

021243Q 

LX I H 

24162Q 

MOV CM 


MOV 

B1 

OQ 

LX I H 

23164Q 

021254Q 

DAD B 


DAD B 


MOV 

AM 


I NX H 


0212600 

MOV BM 


LX I H 

24206Q 

MOV 

MA 


I NX H 


021266Q 

MOV MB 


INR L 


SUB 

M 


I NR L 


021272Q 

MOV CA 


MOV AB 


SBC 

M 


ORA C 


021276Q 

JZ 

2131 IQ 

MOV LI 

206Q 

MOV 

CM 


I NR L 


021305Q 

MOV BM 


CALL 

2052Q 

LX 1 

H 

24162Q 

MOV CM 


021315Q 

MOV B1 

OQ 

LX I H 

23164Q 

DAD 

B 


DAD B 


021324Q 

XCH0 


LX I H 

24216Q 

MOV 

AM 


I NR L 


021332Q 

MOV BM 


ORA I 

1 IQ 

MOV 

CA 


MOV AB 


021337Q 

ORA I 

OQ 

MOV BA 


MOV 

AC 


STAX D 


021344Q 

I NX D 


MOV AB 


STAX 

; D 


MOV LI 

1 62Q 

021351Q 

INR M 


JMP 

21220Q 

LX I 

H 

24172Q 

MOV AM 


021361Q 

ANA I 

17Q 

SUB I 

OQ 

JNZ 


21376Q 

CALL 

61 40Q 

021373Q 

JMP 

21431Q 

LHLD 

24172Q 

MOV 

AM 


SUB I 

201 Q 

021404Q 

SUB 1 

IQ 

SBC A 


LHLD 

24170Q 

MOV CA 


021413Q 

MOV AM 


1 NX H 


MOV 

DM 


MOV ED 


021417Q 

PUSH B 


XRA A 


SUB 

E 


POP D 


021423Q 

SBC A 


ANA E 


RRC 



CC 

6140Q 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 24 


191 



021431Q 

LX I H 

24163Q 

MOV CM 


DCR C 


DCR 

L 


021437Q 

MOV MC 


MOV LI 

166Q 

MOV MI 

377Q 

LX I 

B 

2Q 

021447Q 

LHLD 

2421OQ 

DAD B 


MOV AM 


SUB 

1 

201Q 

021456Q 

JNZ 

21475Q 

LX I H 

24210Q 

MOV CM 


INR 

L 

021466Q 

MOV BM 


CALL 

2052Q 

JMP 

21664Q 

XRA 

A 


021476Q 

LX I H 

24167Q 

SUB M 


JNC 

21615Q 

MOV 

LI 

21 OQ 

021507Q 

MOV CM 


INR L 


MOV BM 


I NR 

H 


021S13Q 

MOV LI 

2440 

MOV MC 


I NX H 


MOV 

MB 


021520Q 

LHLD 

24644Q 

MOV AM 


I NX H 


MOV 

BM 


021526Q 

MOV CB 


XRA A 


SUB C 


JNC 


21551Q 

021534Q 

DCX H 


MOV AM 


I NX H 


MOV 

BM 


021540Q 

LX I H 

24644Q 

MOV MA 


I NX H 


MOV 

MB 


021546Q 

JMP 

21520Q 

LX I H 

24170Q 

MOV CM 


INR 

L 


0215560 

MOV BM 


LHLD 

24644Q 

MOV MC 


I NX 

H 


021564Q 

MOV MB 


LX I H 

24210Q 

MOV CM 


INR 

L 


021572Q 

MOV BM 


MOV LI 

170Q 

MOV MC 


I NX 

H 


021577Q 

MOV MB 


LX I B 

2Q 

LHLD 

24170Q 

DAD 

B 


021607Q 

SHLD 

24172Q 

JMP 

21664Q 

LX I H 

23153Q 

MOV 

MI 

377Q 

021622Q 

LX I H 

2421OQ 

MOV CM 


INR L 


MOV 

BM 

021630Q 

CALL 

2366Q 

LX I H 

24647Q 

MOV MA 


SUB 

I 

201 Q 

021641Q 

JZ 

21653Q 

MOV CM 


CALL 

6527Q 

JMP 


21622Q 

021653Q 

DCR H 


MOV LI 

21 OQ 

MOV CM 


I NR 

L 


021660Q 

MOV BM 


CALL 

2052Q 

RET 


LX I 

B 

420Q 

021670Q 

CALL 

4365Q 

CMA 


RRC 


JNC 


21706Q 

021700Q 

LX I B 

420Q 

CALL 

4664Q 

CALL 

1444Q 

LX I 

H 

2421OQ 

021714Q 

MOV MA 


I NX H 


MOV MB 


MOV 

CA 


021720Q 

CALL 

5027Q 

LX I H 

23155Q 

MOV MI 

377Q 

MOV 

LI 

1 1 3Q 

021732Q 

MOV MI 

2Q 

LHLD 

23076Q 

MOV AM 


LX 1 

H 

23113Q 

021743Q 

SUB M 


JC 

21776Q 

INR M 


MOV 

CM 


021751Q 

DCR C 


MOV BI 

OQ 

LHLD 

23076Q 

DAD 

B 


021760Q 

MOV AM 


MOV EA 


LX I H 

2421OQ 

MOV 

CM 


021766Q 

I NR L 


MOV BM 


CALL 

2640Q 

JMP 


21734Q 

021776Q 

RET 


MOV Cl 

31 Q 

MOV El 

OQ 

MOV 

DI 

OQ 

022005Q 

CALL 

462Q 

LX I H 

23105Q 

MOV MA 


INR 

L 


022015Q 

MOV MA 


INR L 


MOV MA 


RET 



022021Q 

LX I H 

242200 

MOV AM 


RRC 


JNC 


22400Q 

022031Q 

MOV MI 

OQ 

MOV LI 

203Q 

MOV MI 

OQ 

MOV 

LI 

1 70Q 

022041Q 

MOV Ml 

OQ 

I NX H 


MOV MI 

OQ 

LX I 

H 

23150Q 

022051Q 

MOV MI 

OQ 

I NX H 


MOV MI 

OQ 

LHLD 

23114Q 

022061Q 

MOV AM 


I NX H 


MOV BM 


LX I 

H 

2311OQ 

022067Q 

MOV MA 


I NX H 


MOV MB 


LX I 

B 

21 Q 

022075Q 

LHLD 

23074Q 

DAD B 


MOV AM 


SUB 

I 

1 36Q 

022104Q 

JNZ 

22202Q 

LX I B 

22Q 

LHLD 

23074Q 

DAD 

B 


022116Q 

MOV AM 


MOV CA 


CALL 

10005Q 

ADD 

A 


0221240 

ADD A 


ADD A 


ADD A 


LX I 

D 

23Q 

022132Q 

LHLD 

23074Q 

DAD D 


MOV CA 


MOV 

AM 


022140Q 

PUSH B 


MOV CA 


CALL 

10005Q 

POP 

D 


0221460 

ORA E 


MOV BI 

OQ 

MOV CA 


LX I 

H 

22712Q 

022155Q 

MOV MC 


INR L 


MOV MB 


LX I 

H 

22712Q 

022163Q 

MOV EM 


INR L 


MOV DM 


LX I 

B 

4000 

022171Q 

CALL 

15420Q 

LX I H 

23110Q 

MOV ME 


I NX 

H 


022201 Q 

MOV MD 


LX I B 

25000Q 

LX I H 

23110Q 

MOV 

EM 


02221 IQ 

INR L 


MOV DM 


CALL 

1744Q 

CALL 

4322Q 

022221Q 

CALL 

51 16Q 

CALL 

1444Q 

LX I H 

24216Q 

MOV 

MA 


022233Q 

I NX H 


MOV MB 


MOV LI 

1 62Q 

MOV 

MI 

IQ 

022241Q 

MOV AI 

376Q 

LX I H 

24162Q 

SUB M 


JC 


22313Q 

022252Q 

MOV CM 


MOV BI 

OQ 

LX I H 

23164Q 

DAD 

B 


022261Q 

DAD B 


XCHG 


LX I H 

24216Q 

MOV 

AM 


022267Q 

INR L 


MOV BM 


ORA I 

1 IQ 

MOV 

CA 


022274Q 

MOV AB 


ORA I 

OQ 

MOV BA 


MOV 

AC 


022301Q 

STAX D 


I NX D 


MOV AB 


STAX D 


022305Q 

MOV LI 

1 62Q 

INR M 


JNZ 

22241 Q 

CALL 

21777Q 

022316Q 

LHLD 

23074Q 

I NX H 


MOV AM 


SUB 

I 

40Q 

022325Q 

JZ 

22425Q 

CALL 

21665Q 

MOV LI 

74Q 

MOV 

CM 


022336Q 

INR L 


MOV BM 


MOV EC 


MOV 

DB 


022342Q 

MOV Cl 

17Q 

CALL 

462Q 

SUB I 

377Q 

JZ 


22375Q 

022354Q 

CALL 

666Q 

LX I H 

22747Q 

MOV MI 

OQ 

LX I 

B 

40Q 

022367Q 

LHLD 

23074Q 

DAD B 


MOV Ml 

OQ 

JMP 


22425Q 

022400Q 

LX I H 

23104Q 

MOV AM 


RRC 


JNC 


22425Q 

02241OQ 

MOV Ml 

OQ 

CALL 

21777Q 

CALL 

21665Q 

DCR 

H 


022421Q 

MOV LI 

347Q 

MOV MI 

377Q 

CALL 

5722Q 

MOV 

Cl 

377Q 

022432Q 

CALL 

621 4Q 

LX I H 

24777Q 

MOV MA 


SUB 

I 

1 73Q 

022443Q 

JNZ 

22454Q 

CALL 

671 3Q 

JMP 

22430Q 

MOV 

AM 

022455Q 

SUB I 

1 74Q 

JNZ 

22472Q 

MOV Cl 

OQ 

CALL 

6343Q 

022467Q 

JMP 

22526Q 

MOV AM 


SUB I 

1 OOQ 

JNZ 


22506Q 

022500Q 

CALL 

7023Q 

JMP 

22526Q 

MOV AM 


SUB 

I 

1 75Q 

02251 IQ 

JNZ 

22522Q 

CALL 

17745Q 

JMP 

22526Q 

MOV 

CM 

022523Q 

CALL 

6527Q 

JMP 

22430Q 

El 


HLT 




022533Q OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ 



Number 24 

192 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 45 



OSI’s WORD PROCESSOR 


News Release Received: 78 Jan 3 

Ohio Scientific announces its new Word Processor OS-WP1. 
The OS-WP1 is a text editor which operates at both the 
character and line levels. It has internal GET and PUT file 
commands which transfer individual files from memory to 
disk. The OS-WP1 has a full set of printer control commands 
which can be used with virtually any impact or matrix com¬ 
puter printer or word processing printer. The formatted out¬ 
put mode allows the user to perform left and right justification 
of text without line numbers at a designated width of from 
20 to 70 characters. 

The OS-WP1 is ideal for writing letters, manuals, reports, 
and all normal everyday business forms. It can be used directly 
with the Lear Siegler ADM-3A or with the Hazeltine 1500 
and is adaptable to virtually any other conventaional CRT 
terminal via documentation provided. 

The complete Word Processor package, two diskettes and 
a manual is now available for only $79.00 for use on any 
disk-based Ohio Scientific computer system. Available from 
Ohio Scientific, Hiram, OH 44234 

TANDY COMPUTERS 1978 CATALOG 

News Release Received: 78 March 20 

A microcomputer mail-order catalog has just been issued 
by Tandy Computers, the newly created retail division of 
Tandy Corporation, parent company of Radio Shack. 

The 52-page 4-color catalog details a full line of popular 
brand microcomputers and accessories, software packages, 
parts and literature currently in stock. Kits and fully 
assembled micromputer systems listed in the catalog range in 
price from several hundred dollars to more than $20,000. 

Among the nationally known brands carried are Radio 
Shack’s TRS-80, the IMSAI 8080, Vector 1 and 1+, Xitan, 
Equinox 100, Polymorphic System 8813, and many others 
offering beginners, hobbyists, educators and business users 
a wide selection from which to choose. 

In addition, the store carries a complete selection of micro¬ 
processor mainframes, peripherals, software, printed circuit 
accessories and discrete parts and literature. The new store 
also offers programming assistance and on-premises computer 
service. Copies of the new Tandy Computers 1978 Catalog 
are available by telephoning toll-free 1-800-433-1679, or 
by writing to: Tandy Computers, Dept. R7, P.O. Box 2932, 
Fort Worth, Texas 76101 



PERCOM’s MINIFLOPPY FOR SS-50 BUS 

news release Received: 77 Dec 12 

PerCom Data Company has introduced the LFD-400, a 
minifloppy disk system for the SS-50 bus. A complete 1 -drive 
LFD-400 system includes a controller PC board, PROMware 
disk operating system, disk drive and drive power supply, 
interconnecting cable, two minidiskettes, an operator’s 
manual, and an enclosure to house the drive and drive power 
supply. 

The controller board includes special low-voltage-drop 
regulators, a proprietary “bit shifting” compensation circuit, 
an inactivity time-out circuit to increase drive motor life, 
and provision for 3 K byte of PROM. The controller PROM 
may be used completely independently of the disk and 
operating system. 

The LFD-400 PROMware DOS, miniDOS tm , allows SS-50 
bus owners to use their existing software with simple patches. 
The miniDOS tm program includes load and save routines, and 
is contained in a 2708 EPROM, and therefore is ready on 
power-up. 

For more information, contact PerCom Data Company, 
Inc., 318 Barnes, Garland, TX 75042 (214) 276-1968. 



k 


022731Q OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOO 377Q 120Q OOOQ 

022747Q 377Q 120Q OOOQ 001Q OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ 

022765Q OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ 

023055Q OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ 170Q 

023073Q OOOQ 134Q OOOQ 200Q OOOQ OOOQ 200Q 004Q 176Q OOOQ OOOQ OOOQ OOOQ OOOQ 

02311 IQ OOOQ OOOQ OOOQ 006Q OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ 

023127Q OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ 377Q 

023145Q OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ 

023163Q OOOQ 003Q OOOQ 001Q OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ 

023201Q OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ 

024207Q OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ 377Q 377Q OOOQ OOOQ OOOQ 

024225Q OOOQ OOOQ 377Q OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ 

024243Q OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ 

024655Q OOOQ 156Q 163Q 145Q 161Q 151Q 156Q 156Q 164Q 147Q 145Q 143Q 162Q 147Q 

024673Q 143Q 163Q 163Q 160Q 153Q 141Q 144Q 141Q 163Q 144Q 144Q 163Q 165Q 155Q 

02471 IQ 154Q 144Q 166Q 162Q 146Q 167Q 146Q 157Q 146Q 143Q 146Q 162Q 156Q 155Q 

024727Q 146Q 144Q 146Q 162Q 144Q 155Q 144Q 165Q 153Q 160Q 1630 163Q 157Q 162Q 

024745Q 157Q 151Q 157Q 145Q 170Q 156Q 142Q 164Q 156Q 164Q 146Q 146Q 167Q 166Q 

024763Q I860 143Q 154Q 162Q 163Q 172Q 172Q 146Q 163Q 163Q 164Q 

NO PROGRAM ERRORS 

Page 46 Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 Number 24 


193 






Dr. DoBB'S ToURNALof 

COMPUTER 

(Calisthenics Orthodontia 

Running Light Without Overbyte 

Number 25 May 1978 Volume 3, Issue 5 

A REFERENCE JOURNAL FOR USERS OF HOME COMPUTERS 


SOFTWARE 

Programming Language Translation Techniques W.M.McKeeman 4 

Yet Another Body Ken Anderson 17 

Some additions to Lichen Wang’s Robot Control Language 

FORTH for Microcomputers John James 21 

Description of a stack-oriented language 

Resident Memory Test Systems Terry Ritter 28 

Discussion with an example for the M6800 

EDITHA: A Revision of the Fylstra KIM-1 Editor Program H. T. Gordon 34 


HARDWARE 

Proposed Standard for the S-100 Bus George Morrow and Howard Fullmer 

Preliminary Specs from the IEEE Microprocessor Standards Committee 


40 








© David Dameron 1979 




DISASSEMBLER FOR Z80 

News Release Received: 78 Apr 2 

alphaBIT Microsystems announces the UN-Z80 disassem¬ 
bler, output compatible with the TDL Z80 assembly language. 
Features: (1) module to be disassembled can be anywhere in 
the memory space in one or multiple extents. (2) program, 
byte or word format can be specified for each extent. (3) labels 
for forward and backward references are automatically 
resolved. (4) display or printer output will generate addresses, 
object and source. (5) optionally, source code may be gener¬ 
ated and stored on disk or tape, for subsequent input to an 
assembler, Note: All I/O for UN-Z80 is byte oriented. User is 
responsible for providing the necessary interface routines for 
I/O, which is facilitated by JUMP vectors. 

Price: $35.00 on North Star format floppy diskette or 
CUTER format tape cassette. Specify load address of 100H or 
2A00H. Inquire about other media. $5.00 additional for any 
other load address. $2.00 for documentation only, applicable 
to purchase within 21 days. California residents add 6% or 
6.5% sales tax. Contact alphaBIT Microsystems, Box 1107, 
2000 Center Street, Berkeley, CA 94704. 


6800 INDUSTRIAL BASIC 

News Release Received: 78 April 4 

Wintek 4K BASIC is a 6800 BASIC interpreter optimized 
for industrial applications. Control of interrupts, direct mem¬ 
ory read and write, assembly language subroutine, and flexible 
input/output are oriented toward process control and monitor¬ 
ing. 4K BASIC retains many of the features of an interactive 
high level language, including advanced control structures 
including FOR. . . NEXT, IF. . .THEN. . . ELSE, and ON. .. 
GOTO/ON... GOSUB. 

The interpreter may reside in RAM or in PROM. If the 
BASIC program is also stored in PROM, the interpreter will 
immediately enter the “RUN” mode, allowing unattended 
operation in dedicated applications. 4K BASIC is available on 
cassette ($95) or in PROM on a WINCE ROM Module ($299). 
The source listing ($95) and an OEM license ($2,000) are also 
available. WINTEK Corporation, 902 North Ninth Street, 
Lafayette, IN 47904; (317) 742-6802. 


SOLOS TO NORTHSTAR DOS 

News Release Received: 78 March 15 

Microcomputer Resources, Inc. announces a software pack¬ 
age that ties Processor Technology’s SOLOS operating system 
to North Star DOS and BASIC. It allows the use of the CUTS 
tape port for archive storage of data. The VDMhas start-stop 
and speed control which allow changes in speed while the com¬ 
puter is using it. All three I/O ports are supported through 
BASIC, and may be accessed by the *#’ operator. The tape 
routines are accessed as I/O devices. The cursor control keys 
on the SOL are interfaced to North Star BASIC, allowing most 
edits in the line editor without the use of control keys. The 
user may change from the VDM to any of the SOLOS output 
drivers while running the DOS. Additionally, the package 
allows the user to list the directory of a disk while in BASIC. 
Documentation for the software is included on the disk. It 
includes several example programs written in BASIC, and data 
files that explain how to operate the system. This package sells 
for $10.00 for the diskette and program, and $2.00 to cover 
shipping and handling. Microcomputer Resrouces, Inc., 3000 
Medical Park Drive, Suite 107, Tampa, FL 33612; (813) 977- 
5940. 


MORE AD INFINITUM 

Received: 78 March 20 

In the spirit of James R. Van Zandt’s “practical cure” 
for the software piracy problem, let me propose also that 
anyone needing transportation borrow Mr. Van Zandt’s 
car and send a small rental ($2.00, say) to the car’s owner, 
whose name and address is on the registration certificate. 
This rental buys three things: (1) the right to use the car, 
(2) a full tank of gasoline, and (3) the right to claim certain 
rewards from the owner. 

The right to use the car would be valuable for a lot of 
us who want an alternative less expensive than the local car 
dealer but less underhanded than stealing. 

Notice that I recommend that you borrow Mr. Van Zandt’s 
car, not mine. If very many people follow his suggestions with 
my software, I will not be able to afford to maintain my car 
in operable condition, much less fill it with gasoline. And just 
as Mr. Van Zandt is not likely to spend very much of his 
money (the fruits of his labors) on buying cars for others to 
borrow, so I and others in the software business are unlikely to 
spend much labor on making software for others to copy. 

Yes, I do have a better Idea: when a good program hits 
the market (your local computer store or the mail order ads), 
buy it. The author has already decided how much he needs 
to make on each copy to recover his investment. But if he 
sells more than he anticipated, he will be strongly motivated 
to write more (and hopefully better) software. 

It is my opinion that not only is Mr. Van Zandt’s suggestion 
economically unviable, but to suggest it is irresponsible. Such 
suggestions can only encourage good programmers like Bill 
Gates to withhold their products from hobbyists altogether. 
Let us rather encourage programmers to offer low-priced 
software by enlarging their market. 

Tom Pittman 



Number 25 Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 Page 3 


197 



PROGRAMMING LANGUAGE 
TRANSLATION TECHNIQUES 


BY WILLIAM M. McKEEMAN - 

Department of Information Science 
U C Santa Cruz 
Santa Cruz, CA 95064 

The problem of writing a programming language translator 
consists of setting the design objective, selecting the tech¬ 
niques to be used, assembling the tools, carrying out the imple¬ 
mentation, and finally “proving” the result. Properly done, the 
result is an understandable program that can be easily changed, 
is relatively machine independent, and is free of features 
annoying to its eventual users. In practice this is a big, but 
achievable order. 

In the following pages the reader will find illustrations of 
various principles, techniques and tools useful to the translator 
writer. The presentation is tutorial, suppressing some impor¬ 
tant details in the cause of brevity. Further information, 
including a comprehensive list of references, can be found in 
Gries [71] and McClure [72]. 

Some important attributes of a translator are listed in 
Table 1.1. Much of the initial planning of an implementation 
is concerned with choosing among them. The contents of the 
table are too much to assimilate all at once, thus the initial 
sections of this paper present two translators, illustrating two 
recognition algorithms and a simple code generation scheme. 
The paper then proceeds to elaborate upon the theme, work¬ 
ing up to an organization subsuming most practical translators. 

Table 1.1 

Translator Attributes 

The compiler is written in: 

(a) assembly language, or 

(bl systems programming language, or 

(cl general purpose language. 

The recognition algorithm is: 

(a) table-driven, bottom up, or 

(b) recursive, top-down. 

There are simplifications and optimizations on the: 

(a) token string, and/or 

(b) computation tree, and/or 

(c) language-directed code, and/or 

(d) machine code. 

The main measures of efficiency are: 

(a) overall size of the translator, and 

(b) minimum memory in which the translator can be run, and 
(cl translator speed, and 

(d) ease of writing, and 

(e) ease of changing the translator, and 

(f) speed of generated code, and 

(g) density of generated code. 


The mutually self-describing grammars in Table 1.2 illus¬ 
trate a grammatical notation combining the familiar context- 
free constructs with regular expression operators. Quoting the 
literals [Rohl 67] allows grammatical description down to the 
character level if desired. The classes LETTER and CHARAC¬ 
TER must be extended to reflect the actual available charac¬ 
ter sets. 


Table 1.2 

Mutually Self-describing Grammars 

GOAL = TOKEN _LIST; 

TOKEN_LIST = | TLI | TLN 1 TLL | TLS; 

TLI-( | TLN | TLL | TLS) IDENTIFIER; 

TLN = (TLI | TLL | TLS) NUMBER; 

TLL=(TLI | TLN | TLS) LITERAL; 
TLS=TOKEN_LIST SEPARATOR; 

IDENTIFIER 12 LETTER+ ; 

LETTER = 'A' | 'B' \ 'C' | *D' | 'E' | 'F' | 'G' | 'H' | T 
| 'J' | 'K' | 'L' | 'M' I 'N' | 'O' | 'P' | 'Q' | 'R' 

| 'S' | T' | 'U' | -V’ | 'W' | 'X' | 'Y' | 'Z' | ; 

NUMBER-DIG IT+: 

DIGIT = ‘0' | '1' | *2' | '3' | '4' | '5' | '6' 1 '7' | '8' | '9' ; 
LITERAL-'"' CHARACTER + 

CHARACTER-LETTER | DIGIT | SEPARATOR |. 

SEPARATOR- '-' |';' | T| ||'(' |')' |' 

GOAL-RULE +; 

RULE-IDENTIFIER ' = ' FORM ';'; 
FORM-DEFINITION ( *|' DEFINITION) *; 
DEFINITION-CLASS ('-'CLASS)*; 
CLASS=(PRIMARY (I '*' |'+' | NUMBER ))*; 
PRIMARY-IDENTIFIER | LITERAL | '(' FORM ')'; 


Page 4 

198 


Dr. Dobb's Journal of Computer Calisthenics 8t Orthodontia, Box E, Menlo Park, CA 94025 


Number 25 









The first grammar (a lexical grammar) describes both 
grammars as strings of symbols where the actual detail of the 
internal structure of the symbols and separators is given. 
Because two identifiers together look like one, a TLI (token 
list followed by an identifier) may never be followed by 
another identifier. Similar comments apply to quoted items 
and numeric items. The second grammar (a grammar-grammar) 
describes both grammars as sequences of rules where the 
symbol (‘ I ’) separates alternatives. Within a definition we may 
take the difference between two phrase classes (‘—’) or repeat 
them (**’. *+’. INTEGER). We will use this notation exten¬ 
sively in the following pages. 

A translator accepts a source text convenient for program¬ 
ming and transforms it into a target code suitable for execut¬ 
ing. To understand the translation process, one must first have 
a good grasp of the meaning of a source text and a target code. 
For example, the source text 
A = — A+5* B/(B —1); 

might be translated in the following zero-address target code: 

LIT A; 

LIT A; 

LOAD; 

NEG; 

LIT 5; 

LIT B; 

LOAD; 

MUL; 

LIT B; 

LOAD; 

LIT 1; 

NEG; 

ADD; 

DIV; 

ADD; 

STORE; 

Table 1.5 

Table 1.3 is a grammar for assignment statements. Given 
that the variables must contain integers, such statements have 
well defined meanings. We presume that the reader is familiar 
enough with Algol or PL/1 to be able to follow such examples 
as well as simple programs. 

Table 1.3 

A S' ;:rce Language Grammar 

ASSIGNMENT = VARIABLE ' = ’ EXPRESSION ; 

EXPRESSION = C!'-')TERM ( f ' + ' | 1 - ’)T1-RM) * ; 

TERM = PRIMARY (('*'|'/') PRIMARY)* ; 

PRIMARY = CONSTANT j VARIA3I.E | '(' EXPRESSION ; 
VARIABLE = IDENTIFIER ; 


Note: CONSTANT and IDENTIFIER are processed in the scanner, 
making their definition here irrelevant. 


Table 1.4 is a grammar for the zero-address target code in 
the example above. Even though the meaning of the target 
code is probably obvious to our readers, we will use a few 
words to describe it. 

There is an evaluation stack into which values can be 
pushed. Furthermore, the top values (hence the last ones 
pushed into the stack) are available to be used in computa¬ 
tions. The LIT instruction pushes one value onto the stack. 
The value is either an address (e.g., the address of the variable 
A in LIT A) or a constant (e.g., the value 5 in LIT 5). The 
LOAD instruction assumes the top value on the stack is an 
address. The address is removed from the stack and the value 
found in the indicated cell in memory is pushed onto the stack 
in its place. The STORE instuction must be supplied with two 
items at the stack top. One is the address of a cell in memory. 
The other is a value to be stored into the indicated cell (the 
address is below the value in the stack). After the instruction 
has completed its action, both address and value are removed 
from the stack. The remainder of the instructions are arith¬ 
metic operations. NEG changes the sign of the top value on 
the stack and leaves it where it found it. ADD, MUL and DIV 
operate on the two top elements on the stack, removing them 
and then placing the result back on the stack. 

For both the top-down and bottom-up translators, the 
example above will be worked in detail. 

The step-by-step execution of the example zero-address 
target code is depicted in Figure 1.1. 


Table 1.4 

A Target Language Grammar 
ASSIGNMENT = VARIABLE EXPRESSION 'STORE' ; 

EXPRESSION = 'LIT' CONSTANT | VARIABLE 'LOAD' 

| EXPRESSION 'NEG' 

| EXPRESSION EXPRESSION ('ADD'|'MUL' | ' DIV') ; 
VARIABLE = 'LIT' IDENTIFIER ; 

Note: Both IDENTIFIER and CONSTANT are represented by bit 
patterns in the machine code. The first is to be interpreted as the 
address of the variable and the second as the value of the corresponding 
constant in the source language. 


Successive stack configurations during execution of the code in Table 1.5. 


Note: M(A) = 7, M(B) = 6. 


ill ill HI II 11 


LIT A LIT A LOAD NEG LIT 5 LIT I 


1 -1 

6 B 6 6 6 5 

5 30 30 30 , 30 30 30 

[ij HI 11 11 HI 111 111 

LOAD MUL LIT B LOAD LIT 1 NEG ADD 


ill 11 U 

DIV ADD STORE 


Number 25 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 5 

199 




2. A Top-down Translator 

The recursive recognition technique is one of those ideas 
that is so simple that nobody ever bothers to write much 
about it. It is, however, often the easiest method of writing 
good translators. The prerequisites are a syntactic definition of 
the source language (which then becomes the translator writ¬ 
er’s flow chart) and a recursive language in which to write 
(e.g., assembler, PL/360, Algol and PL/1 but not Fortran or 
XPL). A partial narration of the program carrying out the 
translation depicted in Table 1.5 follows. Refer to Figure 2.1 
and Table 2.1. 

Initially (line 85), token is undefined and is then set to 
‘A’ by the first call of scan (line 87). Then assignment is called, 
immediately calls variable (line 16) which checks to make sure 
an identifier has been found (line 77) (notice that we hid this 
decision inside the undefined function identifier to avoid 
unnecessary detail). Since ‘A’ is an identifier, the test is passed 
and the pair ‘LIT’ ‘A’ is emitted, and ‘A’ is discarded by a 
second call of scan (line 81), leaving *=’ in token. Returning 
from variable to assignment (line 16) the *=’ is noted, then 
discarded and replaced by the next token The right-hand 
side of the assignment is then processed with a call to expres¬ 
sion. Table 2.1 gives a complete summary of the remaining 
actions; the reader is encouraged to complete the simulation 
of the recursive translator. 

The success of the recursive technique is due to several 
circumstances. First, the mapping from a syntactic descrip¬ 
tion to a recognizer (Table 1.3 to Figure 2.1) is so simple that 
an experienced programmer can do it as fast as he can write, 
although Frank DeRemer points out that the simplicity rapidly 
disappears if good diagnostics and error recovery are required. 
Second, the programmer can insert his generator code between 
any two statements of the recognizer. This implies that when¬ 
ever any structure entity of the source language has been 
recognized, the programmer has a convenient opportunity to 
attach an interpretation to it. Third, because the local variables 
of recursive procedures are in fact in a run-time stack, the pro¬ 
grammer may associate temporary information with any 
source language construct (see the variables t in procedures 
expression and term, lines 24 to 42) without laboriously build¬ 
ing stack data structures in his translator. One must reflect on 
the pervasive nature of stacks in translators to appreciate the 
value of getting them for “free”. Perhaps the most important 
advantage of the recursive technique, aside from its simplicity, 
is the fact that it can handle complex languages without catas¬ 
trophic costs in size or speed. 

The recursive technique is of no particular help beyond the 
production of a language-directed code (e.g., zero-address 
code for assignments). Since the great bulk of the work in 
writing a compiler for the average modern computer comes in 
turning the language-directed code into good machine 
language, the helpful properties detailed above can look rather 
irrelevant to a hard-pressed implementor. 

In addition to the need for a recursive language in which to 
write, the recursive technique has one serious disadvantage. 
The generator and parser are thoroughly mixed together, pre¬ 
venting the programmer from treating them separately for pur¬ 
poses of documentation, maintenance, memory management, 
testing, and so forth. In particular, it is hot unusual to find 
target code dependencies in the source language recognizer, 
which prevent the recognizer from being machine independent. 

Figure 2.1 

A Simple Recursive Translator for Assignments into Zero-address Code 

1 translate: 

2 procedure; 

3 /* scan and emit are left undefined in this 


4 example to avoid irrelevant detail */ 

5 scan: 

6 procedure returns (character varying); 

7 /* produces the next token each time called *, 

8 end scan; 

9 declare token character varying; 

10 emit: 

11 procedure (op character varying); 

12 /* assembles zero-address code */ 

13 end emit; 

14 assignment: 

15 procedure; 

16 call variable; 

17 if token = '=' then token = scan; 

18 else call error; 

19 call expression; 

20 call emit ('STORE'); 

21 end assignment; 

22 expression: 

23 procedure; 

24 declare t character (1); 

25 /* check for unary minus */ 

26 if token = '-' then 

27 do; 

28 token = scan; 

29 call term; 

30 call emit ('NEG'); 

31 end; 

32 else call term; 

33 do while token = '-’ I token = '+'; 

34 t=token;token =scan; 

35 call term; 

36 if t = '-' then call emit ('NEG') ; 

37 call emit ('ADD'); 

38 end; 

39 end expression; 

40 term: 

41 procedure; 

42 declare t character (1) ; 

43 call primary; 

44 do while token = '*' I token = 7'; 

45 t = token;token = scan; 

46 call primary; 

47 if t = '*'then call emit ('MUL'); 

48 else call emit ('DIV'); 

49 end; 

50 end term; 

51 primary: 

52 procedure; 

53 /* check for a constant */ 

54 if constant (token) then 

55 do; 

56 call emit ('LIT') ; 

57 call emit (token) ; 

58 token = scan; 

59 end; 

60 /* check for parenthesized expression */ 

61 else if token = '(' then 

62 do; 

63 token - scan; 

64 call expression; 

65 if token = ')' then token = scan; 

66 else call error; 

67 end; 

68 /* assume that it is a variable */ 

69 else 

70 do; 

71 call variable; 

72 call emit ('LOAD'); 


Page 6 Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 

200 


Number 25 



73 end; 

74 end primary; 

75 variable: 

76 procedure; 

77 if identifier (token) then 

78 do; 

79 call emit ('LIT'); 

80 call emit (token); 

81 token = scan; 

82 end; 

83 else call error; 

84 end varaible; 

85 /* main body of translator */ 

86 /* get initial token value */ 

87 token = scan; 

88 call assignment; 

89 end translate; 


44 

45 

46 
54 
61 

71 
77 
80 

81 

72 

47 


* B/(B-1) 

B /(B-1) 


B /(B-1) 

/ (B-1) 

/ (B-1) 

/ (B-1) 


LIT B 

LOAD 

MUL 


Table 2.1 

Summary of the Actions of the Top-down Translator 


Active line 
in the 
top-down 
recognizer 

start 

87 

88 
16 
77 
80 

81 

17 

19 

26 

28 

43 

54 

61 

69 

71 

77 

80 


Value 

of 

token 


undefined 

A 


Source text 
remaining 


A= -A + 5*B/(B-1) 
= -A+5* B/(B-1) 

= -A+5* B/(B-1) 
-A + 5*B/(B-1) 

A + 5* B/(B-1) 

+5* B/(B-1) 


Target code 
produced 


LIT A 


44 

45 

46 
54 
61 

63 

64 
26 

32 

43 
54 
61 

71 
77 
80 

81 

72 

44 

33 

34 

35 
43 
54 

57 

58 


B-1) 


- 1 ) 


- 1 ) 

1 ) 

1 ) 


LIT B 


LOAD 


LIT 1 



A 

+5 *B/ (B-1) 

LIT A 

44 


81 

+ 

5* B/(B-1) 

LOAD 

36 

) 

NEG 

72 

+ 

5*B/(B-1) 


37 

) 

ADD 

44 




33 


30 




65 



+ 

5* B/IB-1) 

NEG 

47 


33 




48 


34 

5 

* B/(B -1) 


44 

DIV 

35 




36 


43 




37 


54 





ADD 

57 




33 



5 

*B/(B-1) 

LIT 5 

20 



58 


STORE 


89 


Number 25 


Dr. Oobb's Journal of Computer Calisthenics 8i Orthodontia, Box E, Menlo Park, CA 94025 


Page 7 

201 


3. A Bottom-Up Translator 

The actions of a bottom-up translator separate into the 
actions that produce the canonical parse and those which the 
synthesizer takes when acting on the canonical parse. Because 
the canonical parse is most easily understood in relation to a 
context-free grammar, Table 3.1 is substituted for Table 1.3 
without changing the source language. The procedure synthe¬ 
size (Figure 3.1, line 47), called with the sequence of rule 
numbers in the left-hand column of Table 3.2, will produce 
the sequential language-directed code in the right-hand 
column of Table 3.2. 

The remainder of Figure 3.1 is a source language indepen¬ 
dent parsing algorithm driven by the mixed LR(0), LR(1) 
recognition tables in Table 3.3. The tables are interrogated in 
parse (line 100) where state_type is set to the values 0 
through 3 corresponding to the tabulated entries blank, S, SR 
and R which in turn stand for syntax error, stack the present 
state and apply rule N, and apply rule N. 

Table 3.1 

Context-free Grammar for the Assignment Source Language 
rule number rule 

1 ASSIGNMENT=VARIABLE '=' EXPRESSION ; 

2 EXPRESSION=TERM 

3 | TERM 

4 | EXPRESSION ' + ' TERM 

5 | EXPRESSION'-'TERM; 

6 TERM = PRIMARY 

7 | TERM ""PRIMARY 

8 | TERM 7'PRIMARY; 

9 PRIMARY=CONSTANT 

10 | VARIABLE 

11 I'C EXPRESSION ')’ ; 

12 VARIABLE = IDENTIFIER; 

Figure 3.1 

A Bottom-up Translator 

1 translate: 

2 procedure; 

3 /* auxiliary procedures V 

4 /* token handlers */ 

5 scan: 

6 procedure returns (character varying); 

7 /* produces next token each time it is called */ 

8 end scan; 

9 /* global residence of the current token */ 

10 declare token character varying; 

11 unscan: 

12 procedurels character varying); 

13 /* reverses the effect of scan */ 

14 end unscan; 

15 /* stack handlers */ 

16 /* global residence of last token stacked or uncovered */ 

17 declare top _of —token —Stack character varying; 

18 /* global residence of last state stacked or uncovered */ 

19 declare top_of—state-stack fixed; 

20 push: 

21 procedurels fixed, t character varying); 

22 /* push s onto the state stack and t onto the 

23 token stack, s and t are resident in 

24 top_of—state—stack and top_of_token —stack */ 

25 end push; 

26 pop: 

27 procedure!n fixed); 

28 /* discards n items from each stack, placing 

29 newly uncovered values in top—variables */ 

Page 8 

202 


30 end pop; 

31 /* LR table access */ 

32 table: 

33 procedurels fixed, t character varying) 

34 returnsla fixed, n fixed); 

35 /* two-valued procedure returning values found; 

36 in Table 3.3 */ 

37 end table; 

38 left_part: 

39 procedurelp fixed) returnslt character varying); 

40 /* t is the left part of rule p in Jable 3.1 */ 

41 end left—part; 

42 length: 

43 procedurelp fixed) returnslk fixed); 

44 /* k is the number of items on the right side 

45 of rule p in Table 3.1 */ 

46 end length; 

47 synthesize: 

48 procedurelp fixed); 

49 emit: 

50 procedurelop character varying); 

51 /* assembles one item of zero-address code */ 

52 end emit; 

53 /* switch on rule number */ 

54 do case p; 

55 /* no rule number zero */ 

56 

57 /* ASSIGNMENT- VARIABLE '=' EXPRESSION 'J.' •/ 

58 do; 

59 call emit('STORE') ; 

60 return from translate; 

61 end; 

62 /« EXPRESSION = TERM */ 

63 

64 /* EXPRESSION = '-'TERM */ 

65 call emit('NEG'); 

66 /* EXPRESSION" EXPRESSION '+’ TERM */ 

67 call emit('ADD'); 

68 /* EXPRESSION EXPRESSION '-' TERM */ 

69 do; 

70 call emit('NEG'); 

71 call emit('ADD'); 

72 end; 

73 /* TERM = PRIMARY */ 

74 ; 

75 /* TERM = TERM '+' PRIMARY */ 

76 call emit('MUL') ; 

77 /* TERM = TERM T PRIMARY */ 

78 call emit('DIV') ; 

79 /* PRIMARY = CONSTANT */ 

80 do; 

81 call emit('LIT'); 

82 call emitltop—of—token—stack); 

83 end; 

84 /* PRIMARY = VARIABLE */ 

85 call emit('LOAD'); 

86 /* PRIMARY = '(' EXPRESSION ')' */ 

87 

89 do; 

90 call emit!'LIT') ; 

91 call emit (top_of—token—stack); 

92 end; 

93 end; 

94 end synthesize; 

95 parse: 

96 procedure; 

97 declare (state—type, N) fixed; 

98 do forever; 

99 /• get the values from Table 3.3 */ 

Number 25 


Dr. Dobb's Journal of Computer Calisthenics 8i Orthodontia, Box E, Menlo Park, CA 94025 



100 

state-type, N = table!top_of_state_stack, token); 

118 

call synthesize(N); 

101 

do case state—type; 

119 

call pop(length(N)); 

102 

/* syntax error */ 

120 

call unscan(token) ; 

103 

call error; 

121 

token = left—part(n); 

104 

/* stack */ 

122 

end; 

105 

do; 

123 

end; 

106 

call pushln, token); 

124 

end; 

107 

token = scan; 

125 

end parse; 

108 

end; 

126 

/* main body of translate */ 

109 

/* stack and reduce, LR(O) case */ 

127 

/* initialize read-only syntax tables */ 

110 

do; 

128 

call initialize—tables; 

111 

call push(0, token); 

129 

/* initialize the stacks */ 

112 

call synthesize(N); 

130 

call push(1,' '); 

113 

call popOength(N)); 

131 

/* read the first token of the source text */ 

114 

token = left—part(N); 

132 

token = scan; 

115 

end; 

133 

call parse; 

116 

/* reduce, LR(1) case */ 

134 

end translate; 

117 

do; 




Table 3.2 

Association of the Canonical Parse and Code Generation 


rule applied emitted code 

partially parsed text 
A=-A+5*B/(B-1)| 

12 VARIABLE=IDENTIFIER LIT A 

VARIABLE “-A+5* B/ (B—1) 

12 VAR I ABLE “IDENTIFIER LIT A 

VARIABLE = -VARIABLE+5*B/(B-lU 

10 PRIMARY “VARIABLE LOAD 

VARIABLE “-PRIMARY+5* B/(B-1) 

6 TERM “PRIMARY 

VARIABLE “-TERM +5* B/<B-1) J_ 

3 EXPRESSION “-TERM NEG 

VARIABLE “EXPRESSION+5 *B/<B—1) 

9 PRIMARY “CONSTANT LIT 5 

VARIABLE “EXPRESSION +PRIMARY * B/(B-1) J_ 

6 TERM “PRIMARY 

VARIABLE = EXPRESSION + TERM* B/IB-1) J_ 

12 VARIABLE “IDENTIFIER LIT B 

VAR IABLE = EXPR ESSION +TERM* VARIABLE/(B-1(J_ 

10 PRIMARY “VAR I ABLE LOAD 

VARIABLE = EXPRESSION+TERM*PRIMARY/ (B-1) J_ 

7 TERM “TERM‘PRIMARY MUL 

VARIABLE = EXPRESSION + TERM/ (B-1)| 

12 VARIABLE “IDENTIFIER LIT B 

VARIABLE = EXPRESSION + TERM/ (VARIABLE-1) J_ 

10 PRIMARY “VARIABLE LOAD 


VARIABLE = EXPRESSION + TERM/ (PRIMARY-1) 

6 TERM “PRIMARY 

VARIABLE“EXPRESSION+TERM/ (TERM-lH 
2 EXPRESSION “TERM 

VARIABLE “EXPRESSION+TERM/ (EXPRESSION-lH 
9 PRIMARY “CONSTANT LIT 1 

VARIABLE “EXPRESSION + TERM/ (EXPRESSION-PRIMARY)]^ 

6 TERM“PRIMARY 

VARIABLE “EXPRESSION+TERM/ (EXPRESSION-TERM) J_ 

5 EXPRESSION “EXPRESSION-TERM NEG ADD 

VAR I ABLE “EXPRESSION+TERM/ (EXPRESSION) | 

11 PRIMARY = (EXPRESSION) 

VAR I ABLE “EXPRESSION + TERM/ PRIMARY 
8 TERM “TERM/PRIMARY DIV 

VARIABLE = EXPRESSION+TERM| 

4 EXPRESSION “EXPRESSION + TERM ADD 

VARIABLE = EXPRESSION| 

1 ASSIGNMENT “VAR I ABLE “EXPRESSION]^ STORE 

ASSIGNMENT 


Number 25 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 9 

203 


Translation starts on line 126 where the syntax tables are 
initialized, the initial state is stacked and the initial value of 
token is scanned. The recognizer is called and the loop on line 
98 is entered. The variables state_type and N are assigned the 
values 2 (i.e., entry SR) and 12 (the intersection of row 
IDENTIFIER and column 1 of Table 3.3). The case statement 
selects the stack-and-reduce case (line 109) where a dummy- 
state (0) and the identifier ‘A’ are stacked. Synthesize is called 
with parameter 12 (line 112) (line 54) selects the last case (line 
88) causing ‘LIT’ ‘A’ to be emitted. Returning to the parser 
(line 113) one item is popped off each stack, leaving the initial 
state (1) exposed. Token is set to VARIABLE. Execution 
continutes on line 100 where state-type and N assume new 
values 1 and 15, respectively. 

There are programs that produce syntax tables similar to 
Table 3.3 from input similar to Tables 3.1 or 1.3. How it is 
done is an interesting subject but of no direct concern to the 
translator implementor who need only write the procedure 
synthesize. There are, however, fewer opportunities to attach 
interpretations to the parsing actions since synthesize is called 
only from SR and R decision and not S decision. And, except 
for the state and token stack, the programmer must build his 
own data structures. 


Tabic 3.3 

Syntax Tables for Mixed l.R(O) and LR(1) Parsing Algorithm 


state 

12345 6 789 10_11_12 13 14 15 


SR R R R R 

1 2 3 4 5 


S S S S S S S 
C 3 3 3 3 3 3 3 


SR R R R R 

) . 

s 

= ... 2 

S S R R R R 

♦ ..4_4_2_3_4_5_ 

S S SSRRRR 

55 662345 


S S S S 
7 7 7 7 


S S S S 

/ 8 8 8 8 


ASSIGNMENT 

EXPRESSION 


S S 

9 10 


S S S S S 

TERM 

11 11 13 12 14 


SR SR SR SR SR SR SR 

PRIMARY 

6 6 6 6 6 7 8 


SR SR SR SR SR SR SR 

CONSTANT 

9 9 9 9 9 9 9 


S SR SR SR SR SR SR SR 

VARIABLE 

IS 10 10 10 10 10 10 10 


SR SR SR SR SR SR SR SR 

IDENTIFIER 1 

12 12 12 12 12 12 12 12 


Tabic 3.3 is equivalent to LALR(l) parsing tables [UcRcmcr b9] 


4. An Elaborate Compiler 

A compiler accepts source text records and produces 
records full of machine code ready for execution. During the 
process the program may assume several intermediate forms, 
including: 

records 

string of characters 

string of tokens 

phrase-structure tree 

computation tree 

language -specific sequential code 

machine-specific sequential code 

records 

The design of a translator depends heavily on which of the 
above forms are to be used. Generally speaking, the more com¬ 
plex the source text, the higher the payoff in making the com¬ 
piler more elaborate. Once the sequence of intermediate forms 
has been chosen, getting from one form to another represents 
the major implementation problem. Performing transforma¬ 
tions on the intermediate forms to simplify the remaining 
tasks or improve the quality of the resulting machine code 
may be a subsidiary task. The overall data flow for an 
elaborate compiler is given in Figure 4.1. The remainder of this 
article is devoted to explaining the meaning of the various 
algorithms and data structures depicted in the figure. 

5. Transformation on the Token String 

The problem of translating a very complex language (e.g., 
the IBM PL/1) can be simplified by passing repeatedly over 
the token string, each time producing an equivalent token 
string with fewer primitive concepts. The final set of primitives 
is usually taken to include GOTO, IF, assignments and other 
things that map directly onto a conventional instruction set. 

Table 5.1 displays three successive equivalence transforma¬ 
tions on a PL/1 program. Initially there is an array assignment 
which implies a loop (stage 2). The translator has had to create 
some new identifiers which are started with *$’ to avoid con¬ 
fusion. The control expressions of the do-loop are evaluated 
only once implying that the head of the loop contains only 
simple variables (stage 3). The loop itself can then be factored 
into IF and GOTO constructs (stage 4). The advantages are the 
already mentioned reduction in overall translator complexity 
and also the fragmentation of the translator to aid in making 
each piece small enough to permit running in a small memory. 
It has some utility in documenting the meaning of language 
constructs where the transformations are simple enough to be 
easily understood. 

The technique has some disadvantages. It can be slow since 
repeated passes over the token string are required. Clever 
methods of speeding things up may cancel the gain in simpli¬ 
city that led to its use in the first place. There is also a lack of 
theory governing the transformations, leaving a potentially 
confusing series of ad-hoc algorithms. Finally, the transforma¬ 
tions may obscure relations that would have been useful to the 
generators. For instance, the fact that the example in Table 5.1 
can be accomplished with a single memory to memory block 
transfer instruction will never be recovered from the Simpli¬ 
fied” form at stage 4. 


Page 10 

204 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 25 


















records 


character string 


token string 


simplified 
token string 

phrase- 
structure tree 


simplified 
computation tree 

language-specific 
sequential code 


optimized 
language-specific 
sequential code 

machine specific 
sequential code 

optimized 
machine code 

records 


source text 

_ 1 _ 


input record handler 






phases 


-M. 


parser 




phases 


generator 


phases 


emitter 


phases 




output record handler 


executable program 


translator control information 
program listing 

lexical error messages 
string table 


equivalence transformations 
on the token string 


syntax error messages 
symbol table 

undefined symbol messages 

equivalence transformations 
on the tree 


semantic error messages 


equivalence transformations 
on the language-specific code 


equivalence transformations 
on the machine code 


assembly listing 


Figure 4.1 

An Elaborate Compiler 


DECLARE (A, B) (20) FIXED; 

A=B; 

DECLARE (A, B) (20) FIXED; 
DECLARE SI1 FIXED; 

DO $11 = LBOUND(A) TO HBOUND(A); 

A($I1) = B($I1); 

END; 

DECLARE'(A,B"J (20) FIXED; 
DECLARE ($11. $12. $13. $14) FIXED; 
$l2 = LBOUND(A); 

$13=1 

$l4=HBOUND(A); 

DO $11 =$12 BY $13 TO $14; 

A($I1) = B($I1); 

END; 

DECLARE _ (A, B) (20) FIXED; 
DECLARE ($11. $12, $13, $14) FIXED; 
$12 = LBOUND(A); 

$13=1; 

$l4=HBOUND(A); 

$11 =$ 12 ; 


1 = 1 ; 

DO FOREVER; 

IF I > HBOUND(A, 1) THEN RETURN; 
A(I, J) = B(I, J) + (I + 1) *3/J; 

1 = 1 + 1 ; 

END 


Figure 6.1 
A Source Text 


$15 = IF $11 > $12 THEN GO TO $16; 
A($I1) = B($I1); 

$I1=$I1 + 1; 

GO TO $15; 

$16: 


Table 5.1 

Successive Transformations of a PL/I Program Fragment 


Number 25 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 11 

205 


















Figure 6.2 

Phrase-structure Tree for Text in Figure 6.1 


STATEMENT LIST 


GROUP 

T 

GROUP HEAD STATEMENT LIST ENDING 


STATEMENT' STATEMENT 

A 

ASSIGNMENT ; 

VARIABLE = EXPRESSION 

/ / 

^ID ^TERM DCT FOREVER ; STATEMENT STATEMENT ST^fEMENT END 

I PRIMARY IF CLAUSE STATEMENT ASSIGNMENT'; ASSIGNMENT'; 

A /\ /A 

^CONSTANT IF CONDITION THEN RETURN ;yy \ VARIABLE = ^EXPRESSION 

1 EXPRESS iSN^EX^RESS ION VARIABLE = EXPRESSION ID EXPRESSION^TERM 

/ / ' 

TERM TERM IDT ( SUBSCRIPTS ) 

PRIMARY PRIMARY A EXPRESSION , EXPRESSION 

/ I \ \ 

VARIABLE FUNCTION TERM TERM 

I \ | 

ID ID ( PARAMETERS ) PRIMARY PRIMARY 


I / ^ 

I HBOUND EXPRESSION--, EXPRESSION 

/ / 

TERM TERM 

/ / 

PRIMARY PRIMARY 

/ / 

VARIABLE CONSTANT 

/ / 


I 


VARIABLE 



TERM 

PRIMARY 

I 

VARIABLE 


PRIMARY 

I 

CONSTANT 

I 

1 


ID 

I 

I 


ID 

/ 


VARIABLE EXPRESSION + TERM 

/ I / 

ID ID TERM TERM / PRIMARY 

I i / \ 

I J PRIMARY TERM * PRIMARY VARIABLE 

/ / \ \ 

VAR IAB LE ^PRIMARY^CONSTANT ID 

ID ( SUBSCRIPTS ) ( EXPRESSION ) 3 J 


/ 

B EXPRESSION', EXPRESSION EXPRESSION + TERM 


/ 

TERM 

/ 

PRIMARY 

/ 

VARIABLE 

/ 

ID 


I 


TERM 

! 

PRIMARY 

I 

VARIABLE 

I 

ID 

I 

J 



\ 


PRIMARY 

\ 

CONSTANT 

\ 

1 


Page 12 
206 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 25 




6. Transformation on the Computation Tree 


Figure 6.3 


For a given program (Figure 6.1) the recognizer can auto¬ 
matically compute the phrase-Structure tree (Figure 6.2), Computation Tree from Figure 6.2 

which can then be reduced to a computation tree by renaming 



that call for no operation. The computation tree (Figure 
6.3) then constitutes a data structure with an interpretation 
that is invariant under certain transformations. Both reducing 
the number of primitives (simplification) and improving the 
code efficiency (optimization) are useful goals. In the 
example, the concepts of pre-evaluating constant 
subexpressions and linearizing integer multiplication are 
illustrated. The reader should be aware that there are many 
other useful transformations. Frank DeRemer calls the tree 
in Figure 6.3 the abstract syntax tree. The transformation 
from phase-structure tree to abstract syntax tree can be 
formalized to the point of allowing the compiler writer to 
specify it in tabular form, thus avoiding the rather messy 
task of manipulating the tree directly. 

The loop has an induction variable (I) which is stepped 
by a constant amount (1). This fact, discovered by examina¬ 
tion of the computation tree, allows multiplication by a 
constant (or unchanging variable) to be turned into addition. 
The generally slower execution time of multiplication together 
with common subscript algorithms which imply a fixed-point 
multiplication means that there is considerable to be gained. 
Figures 6.4 through 6.13 depict subsequent stages of the 
computation tree as the various phases of the transformations 
are carried out. Each figure should be compared with an earlier 
figure (usually Figure 6.3) to get a before/after view of the 
transformation being illustrated. 

In Figure 6.4, the array A, having declared elsewhere to 
have an upper bound of 8, yields a constant for the function 
HBOUND. In Figure 6.5, the double subscripts are turned 
into simple single subscripts with polynomial values. The 
multiplication of an induction variable is linearized by creating 
a new induction variable ($12) which is stepped by the multi¬ 
plier (Figure 6.7). Then addition of constants are twice pushed 
off onto the new induction variable (Figures 6.8 and 6.9). 
Then the use of the variable I directly after it has been set to 
a constant value allows some pre-evaluation (Figure 6.10). 
Finally, the remaining multiplication by a constant is pushed 
out to the leaves of the computation tree (Figure 6.11) so that 
it too can be linearized (Figure 6.12). The resulting tree is 
displayed in Figure 6.13. 

Tree transformations consume more computational 
Resources than most other phases of translation both because 
the tree occupies a lot of memory and also following the 
link takes a lot of time. Thus the implementor must be careful 
in deciding which transformations are economically justified. 
Tree transformations are easier to carry out when the source 
language does not include a GO TO construct to break up 
sequences of code, thereby making difficult the detection 
of induction variables and the like. 


B I J 


J 


ADD 3 

/\ 

I 1 


Figure 6.4 


Pre-evaluating Constant Subexpressions 

/ 


GT 



I 8 


Figure 6.5 

Replacing Double Subscripts with a Single Polynomial 



Sl|B^ J 
MUL 8 

A 

t 8 



Figure 6.6 


Combining Common Subexpressions 



Number 25 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 13 

207 



Figure 6.7 

Linearizing an Integer Multiplication 


PEAT 


Figure 6.10 

Pre-evaluating Constant Subexpressions 



STORE 


SEQ 


IF STORE STORE STORE STORE 



SJQ 


REPEAT 






STORE 

r\ 

$11 ADD 
0 J 


ST£RE 
$11 J 



Figure 6.8 

Removing Linear Terms from a Loop 


Figure 6.11 

Pre-multiplying by a Constant 


DlV 

/\ 

A^D J 



MUL 3 

A 

I 3 


IF STORE STORE STORE STORE 

/\ 

$11 ADD 

/\ 

$12 J 


SEQ 


STORE STORE 

A /\ 

$12 ADD 

/X 

^UB J 
MUL 8 
I 8 



-42- 


Figure 6.12 

Linearizing an Integer Multiplication 



Figure 6.9 

Combining Variables with a Common Value 


Figure 6.13 

Computation Tree After Simplification and Optimization 



STORE' STORE 

A N 

ii $n j 


REPEAT 


and delete STORE 

$U / ^Al2 



IF STORE STORE 

A\ A /\ /\ 

GT RETURN SUBS ADD I ADD $11 ADD 

A A T\ A 

I 8 A $11 SUBS DIV I 1 

N W 

B $11 $13 J 


STORE 

/\ 

$13 ADD 

l\ /\ 

$11 8 $13 3 


Page 14 

208 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 25 






7. Transformations on Lanuguage-Specific 

Sequential Code 

The computation tree yields the language-specific sequential 
code partly by resort to zero-address code (a left-to-right 
sweep of the tree) and partly by insertion of transfer 
instructions where implied by the tree (IF, THEN, ELSE, 
loop, procedure calls, etc.). The transfers can either be conven¬ 
tional branches or more restricted transfers corresponding to 
CASE, CALL, RETURN, REPEAT, etc. Such a code for the 
tree in Figure 6.13 is given in Figure 7.1. 

Most of the transformations that can be carried out on the 
computation tree can also be carried out on the language- 
specific sequential code [Allen 71, Cocke & Schwartz 70]. In 
addition, the branching structure itself is open to some optimi¬ 
zations (e.g. if the destination of a branch instruction is an 
unconditional branch, the first branch can be reformulated to 
go directly to its ultimate destination). 

8. Transformations on Machine Code 

The translator emits machine code by passing over the 
language-specific code with a simulated language-specific 
machine which, instead of evaluating, emits code (Table 8.1). 
Figure 8.1 displays several stages of the stack during the 
execution of such an algorithm [McKeeman et al 70]. 

Table 8.1 

Source Text and Language-specific Code 
X=X+1; If X < 3 THEN GO TO L; 

LIT X; LIT X; LOAD; LIT 1; ADD; STORE; 

LIT X; LOAD; LIT 3; LT; LIT $L1; BRANCH_FALSE; 
LIT L; BRANCH; $L1: ... 

Most computers have peculiarities that are utilized by 
assembly language programmers but are not directly available 
to the compiler, partly because the opportunities to make use 
of them do not become apparent until after the machine code 
itself has been emitted, and partly because they are special 
to the target machine in question [McKeeman 65]. Table 8.2 
shows a typical situation of this kind. At stage 1 we have a 
good machine code for the two statements. Because addition 
is commutative, the addresses of a pair, LOAD ADD, can be 
interchanged (stage 2) which permits the slow LOAD = 1 to be 
replaced with a fast load immediate LI 1 and also saves the cell 


containing the constant 1 (stage 3). In any pair, STORE X 
LOAD X, the LOAD can be dropped if it is not the destination 
of a branch (stage 4). Any pair of branches, where the first 
is a conditional skip and the second is unconditional can be 
reduced to a single conditional branch (stage 5). Finally, on 
a machine with an add-one-to-memory instruction, the 
sequence LI 1, ADD X, STORE X can be combined into one 
instruction (stage 6). 


Table 8.2 

Transformations on Machine Code 


LOAD X 
ADD =1 
STORE \ 

Stage 1 LOAD X 

LT - 5 

BRANCH 1 A! Si: $L1 
BRANCH' 1. 

$L1: 


LOAD =1 
ADD X 
STORE X 

Stage 2 LOAD X 

LT =3 

BRANCIM AI SH $L1 
BRANCH 1. 

$ LI: 


Figure 7.1 

Sequential Form of Figure 6.13 

LIT 1; LIT 1; STORE; LIT $11; LIT J; LOAD; STORE; LIT $13; 

LIT 6; STORE; LIT $14; CALL... 

$14: LIT I; LOAD; LIT 8; GT; LIT $15; BRANCM_FALSE; RETURN; 
$15: LIT A; LIT $11; LOAD; ADD; LIT B; LIT $11; LOAD; ADD; 
LOAD; LIT $13; LOAD; LIT J; LOAD; DIV; ADD; STORE; LIT I; 

LIT I; LOAD; LIT 1; ADD; STORE; LIT $11; LIT $11; LOAD; 

LIT 8; ADD; STORE; LIT $13; LIT $13; LOAD; LIT 3; ADD; STORE; 
LIT $14; REPEAT; 





Figure 

8.1 




An 

Eir.i 11 c r 

Turning Zeiv-aildress Code into S 

ingle-address 

Code 


Stack 


LlJ 

i x 1 

LlJ 

111 

1 , 

| X | 1 X 



Zcro-Addrcss 

LIT X 


LIT X 

LOAD LIT 1 

ADD 

STORE 


Single-address 




LOAD X 

ADD =1 

STORE 

X 

Stack 

Zero-address 

LIT X 

kJ 

Lid 

LOAD 

ill 

LIT 3 LT 

i 1 ,L1 

1 0 j i a 

LIT $L1" 

1 

BRANCH 

FALSE 

Single-address 



LOAD X 

LT =3 


BRANCH^ 

FALSE SL1 

Stack 

Zero-address 

LIT L 

Ll) 

u 

BRANCH 

$L1: 




Single-address 



BRANQI L 

$ Ll: 




Note: ° represents a value 

in the accumulator 





Stage 3 


Stage 4 


Stage 5 


Stage 6 


LI 1 
ADD X 
STORE X 
LOAD X 
LT =3 

BRANCIIJ-ALSE $L1 
BRANCH I. 

$L1: 


LI 1 
ADD X 
STORE X 
LT =3 

BRANCH_FAI.SE $L1 

BRANCH L 

$L1: 


LI 1 
ADD X 
STORE X 
LT =3 

BRANQI TRUE 


INDEX X 
LT =3 

BRANQI TRUE L 


Number 25 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 15 


209 









Innumerable ingenuities can be applied. Since the savings 
can be dramatic (as in the example), the technique is useful 
and popular. Nothing makes the hero-author of a compiler 
happier than producing really subtle correct code, beating 
the assembly programmer at his own game. One must, 
however, guard against introducing errors into the code as 
a result of not carefully considering the conditions under 
which the transformations leave the program invariant. 

9. Fragmentation Planes in the Translator 

There are many reasons to want to break a compiler into 
pieces. The ability to run the translator in a small memory 
is one which the computer salesman and computer purchaser 
feel is important. The problem of managing large 
programming projects has demanded a task organization 
which results in many small well-defined subtasks. Further, 
there seems to be a definite limit on how complex a task can 
be attempted without incurring exponentially growing delays 
and costs. There even seems to be a critical size beyond which 
repairing an error introduces on the average of more than one 
error. And, finally, no matter how well a system seems to 
perform, it is good engineering practice to know how well and 
under what range of conditions the system will perform. Such 
knowledge comes from understanding; understanding comes 
from not having to consider something complex all in one 
mental step. 

There are some principles that guide the choice of natural 
boundaries between program modules. A boundary is good if 
there are a few references across it into other modules and 
those references are relatively infrequently exercised. A 
boundary is good if the information flow through it can be 
simply described. A module is good if its function can be 
simply described. A data flow is good if it can be totally 
produced before any of it is consumed (meaning no feedback 
is needed across the boundary). A set of modules is good if 
execution activity can be isolated in small subsets (working 
sets) over substantial spans of time. And such a set is well- 
designed if particular dependencies are isolated in small 
subsets (e.g. target language does not appear until the very 


MIND’S EYE SOFTWARE 

News Release Received: 78 April 5 

Mind’s Eye Personal Software produces and distributes soft¬ 
ware for the personal and hobbyist computer user. Initially, 
this consists of cassette tapes for the Commodore PET Person¬ 
al Computer. 

Mind’s Eye will sell tapes either on a direct mail-order 
basis, or at a quantity discount rate for resale by other vendors. 
The direct mail price will be approximately 10% less than the 
suggested retail price for the other vendors. 

A Catalog will be available soon which will list and describe 
the programs available from Mind’s Eye. We hope, as we grow, 
to offer an extremely large variety of programs for your 
perusal. The Catalog will also contain many other things of 
interest, such as royalty policies, expected programming stan¬ 
dards, and a section of advertisements by vendors of PET 
related hardware. 

To attract a variety of programs and to assure their quality, 
royalties in the range of 10-20% of the RETAIL price of the 
software will be offered. Submitted programs will be checked 
and “editorial” suggestions made to the authors to maintain a 
high level of reliability and creativity. Authors who are willing 
to make suggested changes will receive higher royalties as a 
result. 

As this is a Personal software company, please do not hesi¬ 
tate to send programs which you feel may be of limited 


last stages in Figure 4.1). It is also of value if one module 
can be changed without involving the processing of many 
other modules. We can suppress detail by considering a subset 
of the modules as a single module where the internal data 
transactions and control transfers are ignored. The boundary 
around such a supermodule is good if the resulting module 
obeys the rules above. 

The techniques of engineering programs are being 
developed. One of them is modular programming which, 
when applied to translators, depends upon the organization 
of the translator (e.g. Table 4.1) and upon the application of 
the principles above. The time should soon come when 
translators are well-engineered as a rule, not as an exception. 


REFERENCES 

Allen, Frances E„ "A Basis for Program Optimization,” Computer 
Software, IFIP (1971), page 64. 

Cocke, J. and Schwartz J.T., "Programming Languages and their 
Compilers (preliminary notes)", Courant Institute of Mathematical 
Sciences, N.Y.U., N.Y. (April 1970). 

DeRemer, F.L., Practical Translators for LR(k) Languages, Ph.D. 
dissertation, M.l.T. (September 1969). 

Dijkstra, E.W., Notes on Structured Programming, Report 241, 
Technische, Hogeschool Eindhoven (1969). 

Gries, D., Compiler Construction for Digital Computers, John Wiley 
& Sons (1971). 

Lehman, M. & Belady, L., "Programming System Dynamics..." 
IBM Research RC3546 (September 17, 1971). 

McClure, R.M., "An Appraisal of Compiler Technology," Proc. SJCC 
(1972) page 1-9. 

McKeeman, W.M., Horning, JJ. & Wortman, D.B., A Compiler 
Generator, Prentice Hall (1970). 

McKeeman, W.M., "Peephole Optimization," Comm. ACM 8, 7 page 
443 (July 1965). 

Parnas, D.L., "Information Distribution Aspects of Design Method¬ 
ology," Computer Software, IFIP (1971) page 26. 

Rohl, J.S., "A Note on Backus-Naur Form," Computer Journal, 
Vol. 10, pages 336-337 (1967-68). 


interest. Mind’s Eye has carefully considered the problem of 
low-volume sales of individual programs, and has designed its 
facilities to be capable of handling low-volume programs 
profitably. 

Mind’s Eye is especially interested in programs which 
1) solve a particular problem that you have had, 2) educational 
items, including ones which are “trivial”, 3) programs depen¬ 
dent on the PET operating system, 4) machine language 
programs, 5) useful utilities, and naturally, 6) games and 
amusements. Contact P.O. Box 354, Palo Alto, CA 94301; 
(415)326-4039. 


FLOPPY CONTROLLER USES 
NEW MOTOROLA CHIP 

News Release Received: 78 Mar 13 

WINTER Corp. has incorporated the new Motorola MCM 
6843 floppy disk controller IC into a low cost floppy disk 
controller. The 4 Vt” x 6'A” module interfaces to any full size 
or mini floppy disk drive. The module supports both hard 
and soft sectoring, IBM 3740 or user programmable read/write 
format, automatic CRC generation/checking, and 
programmable step and setting times. $199.00 unit price. 
WINTER Corp., 902 N. 9th Street, Lafayette, IN 47904; 
(317) 742-6802. 


Page 16 

210 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 25 


SOME ADDITIONS TO LICHEN WANG'S ROBOT CONTROL LANGUAGE 


BY KEN ANDERSON 

KEA Microdesign 
P.O. Box 6531 Stn. A 
Toronto, Canada M5W/X4 


Dear Jim: Received: 78 Mar 24 

Enclosed is a program listing of ‘Yet Another Body’ for 
Lichen Wang’s Tiny Robot Language. In this body, the 
VDM/Sol display is shared to map robot movement during 
the ‘Body Mode’ as well as display mind contents during the 
‘Mind Mode’. Please note that a graphics density of 128 x 48 
cells is accomplished on the VDM/Sol display by addition of a 
‘GraphicAdd’ piggyback board. This program is easily convert¬ 
ed for Poly/SSM type displays by modification of the cell 
mask table (see listing). 

Ken Anderson 

For a full description of the TINMAN language, also known 
as WSFN, and 8080 source listing, see DDJ Volume 2, Issue 8, 
pp. 8-19 ‘An Interactive Programming Language for Control 
of Robots’. Hardware requirements are a Sol or VDM display 
equipped with GraphicAdd graphics board, an ASCII key¬ 
board and an 8080 system with 8K of RAM at 0-1FFF. On 
initial startup of WSFN, the computer asks ‘Are my graphics 
software-selectable?’ Keying ‘Y’ will enable the GraphicAdd 
graphics for this and subsequent re-entries to WSFN. Then the 
‘Mind Mode’ is entered. If valid mind contents exist at 1C00 
in RAM (see the Mind, below), the mind is displayed—if not, 
then the mind is first brainwashed. This feature allows 
previous ‘memories’ to be reloaded from mass storage before 
re-entry to WSFN. 

The Mind 

This is functionally identical to Lichen Wang’s description. 
However, this mind is located in RAM at 1C00-1FFF. After 
every keypress, the ‘Mind Mode’ is entered, and the VDM is 
updated with the latest mind contents. Thus, during all mind 
operations, the display appears as described in DDJ. A few 
more commands have been added for convenience: 

ESC (IB hex) Exits to Monitor 
CTL B (02 hex) Brainwashes the mind for a fresh start 
; is translated to + to save wear on the shift key 

*- (01 hex) back-arrow backs up cursor to correct typos 
NOTE—does not move over brackets. 

Yet Another Body 

The graphics capability of 128 x 48 bit-mapped cells is 
used for tracing robot movement. The display is arranged to 



Sol with GraphicAdd demonstrating ROBOT program. A mix of Body 
and Mind modes was arranged by: Z to initialize movement 

then b to dump Mind on display 
then E to map movement without 
first clearing display (i.e.. Mind) 


‘wrap-around’ movements that go beyond screen limits. 

‘Body Mode’ is entered whenever a body command is exe¬ 
cuted. This mode is maintained until the next keypress, which 
returns to ‘Mind Mode’. 

Body commands are identical to those previously described 
in DDJ. 

One additional command is: 

S Switch trace—the trace is left as per definition W or B 
until it crosses over itself—then the intersection is switched 
B/W or W/B. This command allows complicated patterns to 
develop without eventual ‘white-out’ of the display. 


Number 25 


Or. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 17 












Robot Command Summary 


MIND 


N 

Face North (up) 



W 

Leave White trace 

(space) 

No operation 

B 

Leave Black trace 

+ (or;) 

Increment accumulator 

S 

Switch trace state on overlaps 

— 

Decrement accumulator 

C 

Clear screen (to B or W) 

A 

Current value of accumulator 



T <then><else> 

Test if A>0 : then <then> 

Examples: 



if A = 0 : then <else> 

1. Windmill 


? <then><else> 

Randomly choose <then> or <else> 

DX (CA 

. -8 (HNARP +)) 

D <char><commands>Define <character> to 

DP (... 

..) where P is a curve 


be <commands> 

X 

draws a windmill 


NOTE: recursive macros are allowed! 



n <command> 

repeat <command> n times 

2. Spiral 



where n = integer or A: current value 

DGF 

step length 



DM (HN 23 F CA(AG —2R)) 

EDITING 


A- 

zero accumulator 



50+ 

set A = 50 

DEL 

Erase line 

M 

draws a spiral 

<-(or CTL A) 

Erase character, but not brackets 



CTLB 

Brainwash mind 

3. Hilbert Curve 

ESC 

Escape to monitor 

DUT (- 

V G 6R U 2R G U G 6R V +) 6R 



DVT (- 

U 2R G V G 6R V 2R G U +) 2R 

BODY 


DG4F 




DZ (HN 23F 2R 63F C F 2R U) 

F 

Move Forward one grid cell 

A- 


H 

Go Home to center screen 

5+ 

set A = 5 

R 

Rotate 45 degrees clockwise 

Z 

draw curve 





ooooooooooooo 

-iMr\<iiAvor'coa'0'HN'^ 
000000000—1—1^ — 
ooooooooooooo 


oooooooooooo 

<riA'or^coo'a'’Ni^<iio 

—• •—I —1 •—ICSICSJCNO'JCSICN 

oooooooooooo 


ooooooooooooo 
vOI^Q^O — CN'^<J'A-i)^aD 

ooooooooooooo 


oooooooooooo 

o\o-<(M^<iir\\or^covo 

^<j<r<r<r<j<r<r<r<j<rLT' 

oooooooooooo 


ooooooooooooo 

HNr\<riAvor'COO'OH(Mn 

lAiAiAiAiAiAiAiAiTi'il'fl'O'O 

OOOOOOOOOOOOO 



a C <CO CD CNl CD CSI CD <N| —1 CSI O f'N 

O CJ C_> C_J — O —1 O U.OOOOO 

O CJ CD CJ (N f'N -t U UL. < O' U- U. sO CJs CO <T CMOCvJCMf^»tMOr r \r^if^ 

O C_) O — OOO U. U. CJ U. Q CJ CD <T Q O' r*-\ OljOOOOOOOO 

HLJUJN'OnUUCN^ — Li_ KS O — QO —' Q Q O C r^\ <T ^<[D-i[0<uj' , "OUNQNO'NCDI N U^< 

N^U-U^NMi-UU l^<QU ^ C_) O CSI CJ U CJ U CJ — <ri'-HO<rLO^O<J<J^OsOO<JrliAOir\N 

OOK\'?'00'CQCJQL.NiAiAiriir»Q^vJ\fJ(^^M^'0lsQKMnoiamu-'CDuC00'0'0N^CJQL.ONl , i/\'0Q^inULJU.'HN<JiMsC0<<£< 
OOOOOOOOOO — — — — —iOOOOONNi/'in'/\SMMMMJ'a'<<<(jLHJtJU'/'iAiA'C'0'fl'0'C'0'0'0'0'0'0SNNMsr'M— I— 
0<<<<<<<<<<<<<<OQQOOQQOOOOOOOOOOOQQOUOaONNNNNNNNNMNNNN(MNNNNNNNN 
ocjc_)Ljcjc_)CJCJcjcjc_)c_)CJc_)C_)oooaooooooooooooooooooooooaooooooooooooooooaoooo 


Page 18 

212 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Number 25 




d 

o 


CO 

in 


X 

eta 

Q 

O 


UJ 

QC 

(_) 

in 


cr 

c_) 

to 


- o 

X d I 2 Q X 


x—*xrsixxh- 
2 >• X 2 X X X 
Miuncuict; 


Q- Q 
N U 2 
cr —. 
•- X 
uj ~ 

in in t— 

UJ UJ UJ 

a: >- in 


- - ^ < < x 


XX • C_) 


< o d ► 
: •- x : 
inz ► 


O P" H-. 


x in 


a_ — 

C 2 

CC □ O 


X 


in . 


Q- •— C_> d 
x a: m u m > 

in uj y in 1 
■t s in - a. in 
-in -in d *-< 


2 d 2 ; 


O 5 


in 2 

d — 
3 d 


3 in x ( 

J -— or 1 — t— 

: o in □ ; 
: in uj m c 
XX -c 


< in >- z : 

: in in o: m 

- C_) d o d 
: 1 — 1 H- I 1 — c 
: 1 > uj u 1 

) o_ cd x a: : 

d 1 

. cc in o in < 
h o uj i-h >-* : 

)inir<i-« 

: u u > m < 

) X 2 C 

: cd uj d 2 c 


- x j— o c in - uj 

jo a- mhh iqc x 

3 in in >-2 - in a - x 

:xcx - •-< d a t— oinot 


'<< MNHH -H JCXNQ. 

jQocrvja.2:>'XQ:xx<iox2x 

iooooxoo_ixc-x xqcp-) 


j u_ x in 2 -h 




vc 

cc 3 
o cc 
- o 

x m x 


x Q 

—> d in *-> x o_ *— 

XXXOUI 

cc x in a_1 in a_ cc 



xxxxxxxxxxxxxxxxx 


Ni , N-3iri'flNa)0'0-HNi^^ir\yoMoO'OHNi , i>jin'Or^ 
' - - - ■ inmm'C'OvO'Ovovo'O'O'O'or'r'r^i^i^r'r^N 


-XI CD CM 


xxjxxxxxxxxxxxxxxxxxxx 
His^<nnx^co^OHMr<jin c cd c 
CDCQCOCDC 0 ajDCDCC 0 '^O' 0 ' 0 \C'CMM>^CQ 


o a o o 

N 1 ^ <J lA 

OOOO 
CM CM CM CM 


oooooaooo 

XMDD'QHNn<f 
oooa—(—1—•—1—i 
CMCMCMCMCMCMCMCMCM 


CM 

O 


r*' 

o 


K-\ 

O 


X 

X 


CM 

X 


CM 

X 


X 

X 


X u 
CM X 


d r-, uLom co cm 

U. X U h- U CM CQ 


<J (Ml X U U_ d 

cd m in u h l co i*' 


X CM M3 CM 

OX X d 


U_ CM VO CM 
X CD CD d 


r*"\ X X CM •—1 —1 O' 
N m CD L) Q U (J 


COX'OCDm'OxCMr^XCMO' 

OlMuJUDuLUDminu 


< I s ij u im uj in 

f'n CO X X X K 3 Q 


•—> d on o m x p^\ 
HCMHMDUU 


icuNinniMHin 

ummujcMCMuju 


CDUJlMiTiHCM-iO' 

u m n uj cm cm uj o 


U. Q (M m nO I s x 
O Q Q a Q Q Q 
CM CM CM CM CM CM CM 
X X X X X X X 


O'. O' O' S' S' cc u 

x o a x x a Q 

CM CM CM CM CM CM CM 
X X X X X X X 


uj u 1-1 m n x 
qOuuuju 

CM CM CM CM CM CM 
X X X X X X 


O' CQ X X X X X 
1 . 1 1 ■ 1 1. 1 1 ■ 1 1. 1 1.1 1 ■ 1 
CM CM CM CM CM CM CM 
X X X X X X X 


u.u_u_u_u.u.cMf^'nxmou.u.cMir\'nr'XosooooOLi.cMi-nvooN<mamm 

XXXXXXXXXXX XXX X X XXXXXXXOXX —M •—1 •—i •—t 1 —( •—1 1 —( r—t 
iMCMCMCMCMCMNCMCMCMCMNCMiMinininininininmminr. inrinin^mmininm 
XXOOXXXXXXXXXOXXXXXXXXXXXXOXXOXXXXX 


X X 


r-i CM 
CM CM 


X X 


cACDO'ddddCDX 
CM CM CM CM CM CM CM CM CM 
innnnninrNinn 
xxxxxxxxx 


xxdxxxxx 


<r m 

X C. X o 


d X 

J CSI O d - 


d o 

<-1 - - X 

cc x -j o : 


x o x o < a a 


ID—<>—!•—lXQ_(MIQ_P 
CM X X > > 2 X 2 X L 
era_ixx—*oxo.c 


muiMi 

>m x x x : 
ecu a_1 r 


< < o: < 1 
cm o: *— 2 1— 1 
qc x in •—1 in i 


x Q —1 _j 

in_j>x_i>>-m—1>> 

IMXXXQdXCJXdXX 

QC Q- ix<toxxinoxx 


—JQ_>— >—INICHMIEI 
XXUJQ-2 X C_ 2 2 l 
innicunQucH! 


CL I- Q CD 

X X 2 - 
X X — 

c cr x o 


O-JQQ X X U_ X X— —. CM 

***000 * * * X * * * 2 * * * CE X X 

IXXXXXXXXXXXXXXOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXX 
'i/N'Or'COff'X'iCMin'Cir\'OMDo\Xi-iiMin<jinvOMDO'OHNin<fin'OMDinxHNnvrinioi^caiJ'Q^cMfn<riruor'iao'QHr-' —■ - — - - -- ■— ■— - • -- - ~ - — ~ 

)'0'0'0'0'or'-r^r^.r-r-r^r'-r^r^''-cocQ3oc3oa3a3cococDc»0'0'0'0'0'0'0'a'0'C'XxxxxxxxxX'— — — 1 — 1 — — 1 — 1 . 

1 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX—I —1 — —< —. — —1—IH-< r-* ^ . 


o 

o 


CM 

X 


XXX r-H 

X Q CM CO 


X M 3 
<* M 3 


<J <J UJ CM < 

CD CD U_ X CD 


CDiniHUJ'OinuCMHD' 
O UJ CM KN 1 *"' CM CD O Uj O 


cd in in h m 

O UJ a CM o 


CO U_ CM X CM O' 
X <t 1^1 f'N O 


coincxmQu. xunor^-O'C'-j—lO'ujcMQujaxo' 

UUCMMOX'JMMJ'O'ONUU'U.Uinii.Linu 


< MO n in 
maxuCi 


d c d <c d x o 

1— r- 1-. r'- r-^ 

CM CM CM CM CM CM CM 
X X O O X X X 


u_ -h <r m co 

C'' CD CO CD CO CO 
CM CM CM CM CM CM 
X X X X X X 


O' d C d d CD X 
CD CD CD X X X X 
CM CM CM CM CM CM CM 
X X X X X X X 


q x m m m n <j 
X O' O' O' O' O' O' 
CM CM CM CM CM CM CM 
X X X X X X X 


lT\ X O' X O O 
O' O' O' O' O' O' 
CM CM CM CM CM CM 
X X X X X X 


QQUU.CMn 
O' ff> O' O' < < 
CM CM CM CM CM CM 
X X X X X X 


■o co O' d x uj 
d d d d d d d 
CM CM CM CM CM CM CM 
X X X X X X X 


L.(Mn<J'DO'doDl _I X X X X 

dmxmxxxxxxxaxaxx 

CM CM CM CM CM CM CM CM CM CM CM CM CM C J CM CM 

xxxxxxxxxxaxcxxx 


U_XXXCMP'''<fJ'i 

JDCDCDCDXXXX 

CM CM CM CM CM CM CM CM 

xxxxaxxx 


M 3 O' X X X 

X X X X X 

CM CM CM CM CM 

X X X X X 


Number 25 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 19 


213 


Uj u y uj < o: _i 

> uun u Z o Q- 


—I z z 

CO — •— 

< x p— o 

in i— X o. 

OGQ Ul 

a. z a; > oi 
in ui ce l_j 

— —) X •— cr 

Q in z o 

U < U Q 

U1U2 < 

- < Z Ifl 

in /— o o 
u in < _i z 
inuco- 
x x cd in x 


_iino 

CJ O O 
cr cr cr 
u<< 
in o o 

CD CD 
_!>->- 
O U id 
in y y 


cr o 

< (_i 

x o x 

CJ - UJ 

O < O £ 


O < X CO O X U O hcd M • 


O O j 

CL Q a o 

in u in in 


cjxocjoxxocj: 


—i x a 

o o o x x x x 

oqiuuu<u 

3 UUUUUy U.L 

NOnO—I.-IOOOOO 


<<Q-<<<a-a_a_p— I— X 
3 Q QC O I— 0C ►— OOOU Q-CQCDCDCDCDCDCDCD 
3_jozinxina-Q-a_crin<ooaooooo 
*-> cr. 


*£ •— CJ 00000300000 

LkJ ^^*^^2SCD2XiiSXXiXiXQ:incDCDCDCDCJCyoC3C500'0000 
"OOCjr-jinarOOOOOOOOOOOOOOOOOOOoOOOOOUJUJUJLLJUujLJuiUJUJlLj 


CD 


• in 

X X > 


ooooooooooaoaoooooooaoocooc 

HNK\<lft\OMSO'OHNr^<fiA^MOO'0'HN^< m NO r 
0'0'0'0'(7'CT'0'0'0'0000000000<—<■—<■—<-^<- ~-< —■< - 
NNNNNCMNNIN^^r^r^KNKM^^r^f^l^l^KM^f l<M< 


< u z o in • 

*— ui x >< in<t : 

ininxs-OQQXii 


• cr cr : 
: c_i cj £ 
i in in : 


) o o o 

)HNI^ 

J CSJ CM CM 

\ m m 


ooooooooooooooooooooooooooo 

<JiANOr'-cOONO-HCMPn<inNOf'sC3CyNO—PCMPAsTiAvOrscOCTNO 
CMCMCMCMCMCMPnmPnpnpnpnpnPnpnfn<T<T<T<r<J<J<J<T<J<TiAin 

-- ----- - 


'-< «•-< i>» i-M r", m m r-A r~\ m m pa pa <j <j . 3 - 


0000 

CM PA <J lA 
in in in in 
pa pa m pa 


O O O O ( 
VO MO OM 
in in in lA ' 
in in pa pa r 


) o o o o o 

< CM PA <J lA NO 
) NO VO NO 'O 'O 
' PA fA PA rA PA 


U 0-1 VO 

I s O Q N 


<Qya-<NA<T 

CTNONON<<<<< 

lAlAIAlAIA'ArA'A 

00000000 


lA CO Us <C CD l—J 
<C<T<<C<C< 
fA PA PA IA PA PA 

a o o o o o 


u u Q U U. 
< < < < < 
PA PA PA PA PA 

o a o o o 


0000c 000 


f" < 
CD CD 
PA PA 

o o 


O U- O —< CSI PA 
CD CD CJ CJ CJ CJ 
PA PA PA PA PA PA 

000000 


PA CM PA PA 

0000 

u_o\r^pA cm o on rs —< co pa pavonnoiAia<3niao 
CD Q U CD iA CM in <T <T <T <J 1 A<J 1 A 1 ACSI<J<J 1 A<T<TCSI 

2NQ<NffvHiAQONOCMAQU.<rHi/\IA(JIAriUU. 
3C_)C_)CJPAO<f<J<CSIiAiA<JiACSI<TiA<T<IiA<J<J<T<TPA OOOO 

<rr^<oo-MPAiAr^ONCDOu.ocM<NOco<c_)UJocM<jvo<c_)OuJu.ooooooooooo 

CJCJCJCJOOOOOOOOQUJUJUJUJUJUJUJUJU-Li_U_U.U_U.U.U.U.OOOOOOOOOOO 

PA PA PA PA PA PA PA PA PA PA PA PA PA pa PA PA PA PA PA PA PA PA PA PA PA CD CD CD CD CQ U (J CJ CJ CJ CJ CJ CJ CJ C_) CJ 


ooooooooooooooooooooooooo- 


cr a. 

O o 

C_l 1C 


o uj 

CD PSI 

o —> 


CC O Z 
O CC UJ 

000 
000 
0 < 


> cr 
o o 
X z 


p— > p— cr in 

Ul < UJ o < 

o in in x X 


1 in <000- 


< rsi —1 < x < —< p-i p— < : 
.iix-uQQ.Na.Nui—; 
;nzinojununcri/)i 


—I X < X 

x - U. - •> 

O < Ul 1 _I < c 


CDCJOCJCJ<_lXXXXXXXCD QUQ 


X X O CJ O Q 

ininJXJ>QH>>QH(iuQQ>j-.iijuj»<mM. 
jrMOOXCJXOOZOOO >ZZOOOX>OOOxX 
ccro-ca-ixji<<xx<li/n<<zinzinina. 


*- XX 

x o < 00 

- - •> 00 

I CD U m Q O Q 


ominw<ii:[DuQ>>>HQQQQQQ>a:M>Qi>ci:>jrtH>Q<MH 
- '^^*' , ^^’0z0OOO><<<<<<O<>-O<C_)O<O<X>.o<0ZQ. 

inr-)<XXXXOOOOOOXCrxXOxXcrx-“-_ 


««<PUJ uidCU. if o o 

ooooooooooooooooooooooooooooooooocoooooooooooooooo 

i^vO|sOOvOH(NPA^<AiONCOOvOHNPA<T<AvONCOOvOH(MPA<fiAvOrsaOvOH(S|A<JiAvOMIlOvO-iNPA<J 

<-^<MCMCMCMCMCMCN|CMCMCMmfAPnmmfnpnPnmm<J<T<J < <J <J <T <<3 JlAlAiAiAJ'iAJViAiAiAvflvfWlJUd 

M CM CM CM CM M CM CM CM CM CM CM CM A CNCMCNCMCMCN 


-.-,-,-,^ 1 N i N i N W(N|(SINNCNINAAIAAn 
CM CM CM CM CM CM CM CM CM CM CSI CS| CM CM CM CM CM CM CM CM 


DOOOOOOOOOOC 


si sj si muiui uv u^ lA lAiAiAiA'O'tJ'O'O'O'O'OvOvO'OlsNI— fs |— 
CMrCMCMCMCMCMCMCMNCMNCMCMCMN--....... -- 


.-.i_<wi_.._»<_p<_ii_«i_ii_»i_(i_i<_»v_>i_iOOOOOOOOOOOOOO 
CMPA4mvO|sfflONO-<NlA<IiAvOrsCOffvO'- ~ 


wu. w-iCMIASfiAvOMDOvQ 
_ _ _ _ _ _ . AISA|S|S|S|S|S|SCOCOCOCO(IICOCDCOCDCOO' 
CM CM CM CM CM CM CM CM CM CM CM CM CM CM CM CM CM CM CM CM CM CM CM CM CM CM CM 


<1 PA PA A* CM UJ PA PA lA 


CM UJ CJ U. CJ PA <—I <- 

U.CMPA<J <T <J<T'O^E3UQUQ'niACOO'<[D(jQUJLCMin^jr'(D<a]CJuaun<i/i\ju'UJUUUJ'l 
CMPArAPAPAPAPAPAPAPAPAPAPA<J-0 < <T <J <f <J <J<J -O-OiAiAiAlAiAiAlAlAiAiT 'flvO'O'O'O'fl'fl'O'O'JS 
PA PA PA PA PA PA PA PA PA PA PA PA PA PA PA PA PA PA PA PA PA PA PA PA tA PA rA PA PA PA PA PA PA K PA PA PA PA PA PA PA IA PA PA — 
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOC P—if— 11 —i i—i r-yr-v r-i i— 11—1 r— > 


IN i-i ru- IN UJ PI n in -I b. M -in -i It Q CO vO O' O' I 
O' QCOCD'OCMHO'(MjOCMOO'QCO<fl"OIMCMN 


< ui < O' cm pa ov co in in < cd < O pa vo u. cj cm 

CIU.UCJHHUCJUOCMUJCMIsCOUJ'OfsCO 

U. CM PA vQ f*— CO < £□ CJ Q U O PA <J lA vQ O' CO LI Q Ul ■—I CM IA MB O' tf ff | I*) I ■ I 
■ • s, s s, s. s. s. s. s, >,<JiAiAlAiAiAlAlAir\iAir'0'0'0'0'0'0'fl'0'0'0NNNNNNNNNNN 

IA PA PA PA PA PA PA PA IA IA PA PA PA IA PA PA PA PA IA PA PA |f PA PA PA PA PA PA PA PApAPApAIApAPAIAPA PA PA PA PA PA 

OOOOOOOOOOO 


n co co co 

PA PA PA PA 

OOOO 


A<fiANcoa'<a 

PAPAPAPAPAPAPAPA 

oooooooa 


cjOui—< m<jiA'jco 
COCDCOO'O'O'O'O'O' 
PA PA PA PA PA PA PA PA PA 
OOOOOOOOO 


Page 20 Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 Number 25 

214 






FORTH 


for Microcomputers 



BY JOHN S. JAMES 

1090 Miller Ave. 

Berkeley, CA 94708 

Forth is a unique threaded language ideally suited for 
microcomputers. Programs are incredibly compact; e.g. in 5K 
to 6K bytes you can get the interactive Forth compiler, 
running stand-alone as its own operating system including I/O 
drivers and other run-time routines, plus an assembler written 
in Forth (in case you want to optimize time-critical programs), 
virtual memory software, and a text editor. Not only does all 
this fit into 5K to 6K bytes (of which 4K are written in Forth), 
but it runs in the same space (plus IK buffer), with no 
additional symbol table area, overlays, swapping, or use of any 
other software. 

And while Forth gives all the convenience of interactive 
interpreters, it is very fast. For most applications, the run¬ 
time overhead is 20 to 30% for minis and 70 to 100% for 
micros (compared to 1000% or more which is common for 
interpreters). Number-crunching applications may take 
longer. And when Forth isn’t fast enough, the system’s own 
assembler can be used to re-code inner loops. 

But the best news of all is that software development times 
are cut by half or more over assembly programming. The pro¬ 
gramming is entirely structured (there is no GOTO), and the 
resulting code is re-entrant and can be designed for PROM. 

Forth has been implemented on many microcomputers. A 
recommended configuration is 16K bytes and a terminal; a 
floppy is a good idea for storing source programs (and virtual 
memory for programs and data is supported). Forth works 
well with a CRT, so hard copy is less necessary. 

Forth has existed for several years, and is used commercially 
in a number of installations, but until recently it has been 
priced far out of reach of hobbyists, and even most computer 
experts have never heard of it. However, the language is in the 
public domain, and today low-cost versions are just becoming 
available. Also there is a new Forth Interest Group (787 Old 
County Rd, San Carlos, CA 94070), dedicated to letting the 
serious hobbyist and the professional know about Forth and 
how they can get it. 

How it Works-Overview 

Forth is very different from any other language in common 
use. Perhaps the nearest is Lisp, which it resembles in one way 
only: both are tree-structured languages which implement 
themselves. Forth is an extensible, interactive language. 

Forth starts with about 40 primitives, or operations defined 
in machine language. New operations are defined in terms of 
these. (So far this is like the virtual-machine systems often 
used for implementing transportable languages—e.g. 
Tiny BASIC, or P-code for Pascal. But in Forth, as soon as a 
new operation is defined, it can be used in further definitions 
or executed immediately, exactly as if it were a primitive). 


There are no argument lists in Forth; instead, all routines 
(operations) communicate through a stack. The programmer is 
allowed to define variables, but in Forth, variables themselves 
are operations which place addresses (or other values) onto the 
stack—and which may use the full power of Forth or of 
machine language to compute these addresses. This means that 
users can create their own variable types. 

Forth comes with about 140 routines already defined 
(including the 40 primitives mentioned above). Programming 
consists of defining new routines in terms of previously-defined 
ones, until finally one of them is the whole program which is 
desired. It then is executed by typing its name. Incidently, the 
programmer does not need to know about all 140 operations, 
because some of them are used mainly by the system. After 
all, these 140 implement the compiler, text editor, assembler, 
stand-alone operating system and run-time software, etc. 

Execution is fast because at run time all definitions are 
stored as strings of addresses; and it takes as little as two 
instruction executions (e.g. on the PDP-11) to go from one 
primitive to the next. Higher levels of nesting take a little 
longer, but are done less often. 

Debugging is exceptionally convenient because of the 
modularity of programs. Almost any routine can be executed 
by typing test-data arguments (which places their addresses or 
values onto the stack), then typing the name; no driver 
program is required. In practice, most Forth routines are very 
short, no more than five lines of source code, often one line. 
Each routine is checked out independently, then saved in an 
application-oriented library for future use. 

Blanks are the standard delimiters, so any string of non- 
blank characters can be an operation name. Examples of actual 
names are ‘ASSEMBLER’, ‘ELSE’, *!’, *(\ **’, ‘1 + ’. Even 
numbers can be defined as operations. In one practical joke, 
‘0’ was defined as seventeen. Operation names can be encryp¬ 
ted with embedded non-printing characters. 

Example: A Small Program 

Forth uses postfix notation like the Hewlett-Packard stack 
calculators. This means that operands are written first, 
followed by operators. E.g. ‘(A + B) * C’ in regular (infix) 
notation becomes ‘A B + C * ’ in postfix. This expression is 
executed as follows: place A onto the stack; place B onto the 
stack; add the two values on top of the stack, destroying both 
of them and placing their sum on the stack; place C onto the 
stack; multiply the top two values on the stack, replacing them 
by their product. Notice that there are no parentheses in post¬ 
fix. Also, Forth follows the convention of leaving the operands 
in the same order as in the infix expression; this makes it easy 
to remember the order of arguments for non-commutative 
operations like subtraction. Another Forth convention is that 
all operations should destroy all of their arguments on the stack. 


Number 25 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 21 

215 


Now let’s look at a complete Forth program. Assume that 
the system is in the machine, but not any user programming. 
The task is to write a routine to evaluate the polynomial 
5X 2 -7X -10. The user types 

: POLY DUP DUP * 5 * SWAP 7 * -10 - ; 

This is the complete program. Let’s follow how it works in 
detail. 

The colon ‘’ is one of the Forth operations called defining 
words. A defining word takes the next word in the input 
stream (here ‘POLY’), and prepares an entry for it in the 
dictionary of Forth definitions. As explained later, the 
dictionary is the most central concept in Forth. In fact, in the 
entire Forth system, including compiler, text editor, operating 
system, etc. and also the user’s application software, less than 
50 bytes of code are not part of the dictionary. 

Besides opening a dictionary entry, the colon also places 
the system into compile mode, so that operations which 
follow are compiled into the definitions, instead of being 
executed immediately. It is, however, possible to have special 
immediate operations within definitions, when compile-time 
execution is desired. The system stays in compile mode until 
the definition is terminated by a semicolon. Notice that blanks 
must be used as delimiters for colon, semicolon, and all other 
operations. 

‘DUP’ is an operation to duplicate the top of the stack, 
i.e. to push a copy of the top item onto the stack. ‘SWAP’ 
reverses the top two items on the stack, **’ and ’ are 
multiply and subtract. 

For this illustration, assume that ‘POLY’ is executed with 
the argument ‘6’ on the stack. First the ‘6’ is duplicated twice, 
leaving three copies of ‘6’ on the stack. Then multiplication 
is executed, leaving the stack as follows: 

36 

6 

And ‘5*’ pushes ‘5’ and multiplies, leaving 5X 2 (180) on top 
of the stack, with the copy of X beneath. 

‘SWAP 7*-’ brings the copy of X to the top of the stack, 
multiplies by 7, and subtracts. ‘10 -’ completes the poly¬ 
nomial. 

To test the program, the user could type: 

3 POLY. 

where V is the command to print the value of top of the stack 
(the V could have been included in the definition of ‘POLY’). 
The system responds: 

14 OK 

where ‘OK’ is the prompt meaning that the system is finished 
and waiting for the next input. (The underline means it was 
typed by the system.) 

The user may do some further testing: 

75 POLY . 27590 OK 
90 POLY . - 25676 OK 

Notice the overflow on the last example; the width of the 
stack is always 16 bits in standard Forth, although double 
precision or floating point can be implemented, using more 
than one stack entry to represent a number. 

It is important to test that the routine doesn’t leave any¬ 
thing extra on the stack, because stack overflow is not checked 
during execution and can be hard to diagnose. The instruction, 
‘S, pushes the absolute machine address of the top of the stack 
onto the stack. This address should be the same after a test of 
an operation as before (provided that arguments are supplied 
and results printed by the test). E.g. to test ‘POLY’: 

‘S . 174 OK 
8 POLY . 254 OK 
‘S . 174 OK 


Example: Number Bases 

Any number base can be used: ‘DECIMAL’, ‘HEX’, 
‘OCTAL’, ‘BINARY’, ‘5 BASE’, ‘17 BASE’, etc. For bases 
above 16, letters after ‘F’ in the alphabet will be used as num¬ 
bers. The base can be changed at any time. Only the terminal 
I/O is affected—all internal work is in binary, so there is little 
cost for arbitrary number bases. E.g. 

DECIMAL 666 23 BASE ! . DECIMAL 15M OK 
This code means: make sure the system is in decimal; enter 
decimal 666, then 23, onto the stack; enter the address of the 
system’s variable ‘BASE’ onto the stack; store (the *!’ opera¬ 
tion) 23 into ‘BASE’, which sets the base to 23 and destroys 
the address of ‘BASE’ and the number ‘23’ on the stack; print 
666 in base 23 (15M); and restore the base to decimal, for the 
sake of future definitions or data entry. By convention, the 
standard base is decimal. 

Example: Scaling 

Software floating point has seldom been implemented in 
microcomputer Forth until recently, and still is not available 
on most systems (it is more common on larger Forth versions 
for minicomputers). Instead, Forth has used some tricks for 
getting around the need for floating point, such as a special 
scaling operation ‘/*MOD’ (multiply and then divide, leaving 
quotient and remainder), which keeps a 24-bit intermediate 
result (instead of keeping only 16 bits as would happen if reg¬ 
ular multiply and divide operations were used). So powerful 
are these special operations that Forth without floating point 
has been used for such applications as non-linear least squares, 
Fourier transforms, and numerical integration. 

For this example, we want a program to multiply a number 
by 3.14159. The challenge is that we are working in fixed 
point, using 16-bit signed numbers with maximum value of 
32,767. Also, the division operation in this version of Forth 
only allows divisors up to 128. 

Although it doesn’t make much difference in this short 
example, the Forth programmer is strongly advised to start 
with a top-down approach, taking the whole task and break¬ 
ing it into operations which could implement the entire job 
in a couple lines of code, then breaking down these operations, 
etc. The alternative is to start out defining operations which 
seem to be relevant to the applications, but may not turn out 
to be useful. Don’t be tempted down the wrong path by the 
fact that the lower-level operations must be typed in first. 

In this case we can break up the task of scaling by a six-digit 
number (which would not even fit into a word) into three 
scalings by two digits each. We notice that divisions are by 
100, which is allowed, and that no intermediate results on the 
stack will be any larger than the answer, avoiding overflow 
problems. The final program becomes: 

: FIRSTSCALE 31 10 */ ; 

: NEXTSCALE 41 100 */ 10/; 

: LASTSCALE 59 100 */ 100 / 10 / ; 

: PI DUP FIRSTSCALE OVER NEXTSCALE + 

SWAP LASTSCALE + ; 

Now the user can type: 

10000 PI . 31415 OK 
or use PI in other definitions. 

The ‘OVER’ operation copies the second element on the 
stack without destroying it and pushes the copy onto the 
stack. The scaling operation ‘*/’ is like ‘*/MOD’, except that 
only the quotient, not the remainder, is returned. 


Page 22 

216 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA